From: Tuukka Lehtonen Date: Fri, 7 Oct 2016 14:15:11 +0000 (+0300) Subject: Fixed acorn db main.state loading rollback reporting. X-Git-Tag: v1.25.0~74 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F19%2F119%2F1;p=simantics%2Fplatform.git Fixed acorn db main.state loading rollback reporting. The previous implementation caused main.state loading to always report the database as requiring rollback which caused the system to always delete all indexes on program startup. refs #6709 Change-Id: Id3d90436c1960faa3ac5ebbc82e817b673934f53 --- diff --git a/bundles/org.simantics.acorn/src/org/simantics/acorn/MainState.java b/bundles/org.simantics.acorn/src/org/simantics/acorn/MainState.java index ec8451cca..7d1580421 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/MainState.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/MainState.java @@ -157,15 +157,16 @@ public class MainState implements Serializable { for (Path p : reverseSortedPaths) { if (!p.equals(latest)) { - // this indicates that there is a possibility that index and vg's are out of sync - // if we are able to find folders with higher number than the current head.state - callback.accept(null); + if (Files.exists(p.resolve(HeadState.HEAD_STATE))) { + // this indicates that there is a possibility that index and vg's are out of sync + // if we are able to find folders with higher number than the current head.state + callback.accept(null); + } uncheckedDeleteAll(p); } else { break; } } - } }