Fixed the bug where the sort order of transactions with equal timestamps
 was not stable, i.e. due to the lack of a total order, different merges
 produced different sortings and hence messed up transactions which
 have already been merged.
This commit is contained in:
Johannes Schlatow 2012-09-10 22:53:44 +02:00
parent 89a7f2a459
commit 68c1ca3f69
4 changed files with 104 additions and 24 deletions

View file

@ -1024,8 +1024,8 @@ void TDB2::merge (const std::string& mergeFile)
mods.splice (mods.begin (), rmods);
DEBUG_STR ("sorting taskmod list");
mods.sort ();
mods_history.sort ();
mods.sort (compareTaskmod);
mods_history.sort (compareTaskmod);
}
else if (rit == r.end ())
{
@ -1232,7 +1232,7 @@ void TDB2::merge (const std::string& mergeFile)
// at this point undo contains the lines up to the branch-off point
// now we merge mods (new modifications from mergefile)
// with lmods (part of old undo.data)
lmods.sort();
lmods.sort(compareTaskmod);
mods.merge (lmods);
mods.merge (mods_history);