]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Improved Acorn database rollback logic.
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 25 Apr 2017 10:13:45 +0000 (13:13 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 11 May 2017 20:16:48 +0000 (23:16 +0300)
MainState will no longer destroy the entire database if the user removes
directories but forgets to remove the main.state file. The information
stored in main.state is now regarded as cached information only and if
it seems invalid or cannot be read, the same normal rollback logic will
be performed every time.

Another enhancement is that rollback will now automatically store the
revisions deleted by the rollback procedure in timestamped
<workspace>/db/recovery/yyyy-M-d_HH-mm-ss/ folders for later inspection
and debugging. Previously the code just deleted all the extra revisions.
Manually removing the recovery-folder is always a safe operation to
perform.

Also fixed a bug in databoard Files class readFile methods that take
a File as argument. Previously all the functions constructed a
BinaryFile using the default mode which is "rw". This unintentionally
made the readFile methods create an empty file if the file did not
exist. All such methods have been changed to use mode "r".

refs #7124

Change-Id: I3ac04d2e33151b33f4982cf7a2edce7ddb896e11
(cherry picked from commit 20dfd0ba5e518a3706cd749c645a0a79480ea36f)


No differences found