]> git.cworth.org Git - notmuch/commitdiff
lib: Simplify upgrade code using a transaction
authorAustin Clements <amdragon@mit.edu>
Mon, 25 Aug 2014 17:26:03 +0000 (13:26 -0400)
committerDavid Bremner <david@tethera.net>
Sat, 30 Aug 2014 17:45:36 +0000 (10:45 -0700)
Previously, the upgrade was organized as two passes -- an upgrade
pass, and a separate cleanup pass -- so the database was always in a
valid state.  This change substantially simplifies this code by
performing the upgrade in a transaction and combining both passes in
to one.  This 1) eliminates a lot of duplicate code between the
passes, 2) speeds up the upgrade process, 3) makes progress reporting
more accurate, 4) eliminates the potential for stale data if the
upgrade is interrupted during the cleanup pass, and 5) makes it easier
to reason about the safety of the upgrade code.


No differences found