Restore may hang if the database contains more than 4 billion records ---------------------------------------------------------------------
Key: CORE-5228 URL: http://tracker.firebirdsql.org/browse/CORE-5228 Project: Firebird Core Issue Type: Bug Components: Engine Affects Versions: 3.0.0, 4.0 Initial, 2.5.5, 2.5.4, 2.5.3 Update 1, 2.1.7, 2.5.3, 2.5.2 Update 1, 2.5.2, 2.5.1, 2.5.0 Reporter: Dmitry Yemanov The problem of the current restore process is that every record is inserted in its own looper roundtrip and thus using its own savepoint. The savepoint number is 32-bit and it wraps around after 2^32 iterations. This particular issue is not related to GBAK, it's common to any single transaction modifying billions of records. Fortunately, old dumb savepoint handling is tolerate to such a wraparound in trivial cases, so GBAK is not affected. Second part of the problem appears when this transaction has also a deferred work (uncommitted DDL). AFAIU, the legacy code implicitly assumes that there cannot be savepoint number zero, but it becomes possible due to wraparound. So DFW_merge_work() is called with old_sav_number = 0 and new_sav_number = 0 and it enters an infinite loop, causing a hang. Workaround for GBAK's restore is to use the -o switch, which restores every table in its own transaction (and also separates a DDL transaction from multiple DML transactions). A noticable improvement could be to avoid savepoints during restore at all. IIRC, InterBase has added the isc_tpb_no_savepoints feature. But I leave this for another ticket. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel