compact: preserve backup database until compacted database is in place
authorTomi Ollila <tomi.ollila@iki.fi>
Thu, 14 Nov 2013 22:03:25 +0000 (00:03 +0200)
committerDavid Bremner <david@tethera.net>
Wed, 20 Nov 2013 00:13:25 +0000 (20:13 -0400)
commitcb6cc296e27fdab85faa4bdd670eda2e0c53b8c2
tree3071c6690727608d16722dfa52c969a71e51494f
parent19a89753ca20b269a131e747238925cce254c627
compact: preserve backup database until compacted database is in place

It is less error prone and window of failure opportunity is smaller
if the old (backup) database is always renamed (instead of sometimes
rmtree'd) before new (compacted) database is put into its place.
Finally rmtree() old database in case old database backup is not kept.
lib/database.cc