Skip to content

Commit

Permalink
Bug when restore was crashed after checkpoint was resolved.
Browse files Browse the repository at this point in the history
  • Loading branch information
laa committed Jan 12, 2015
1 parent 275ef31 commit 1dbe7d4
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion core/pom.xml
Expand Up @@ -114,7 +114,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<argLine>-ea -Xmx2048m -Dindex.flushAfterCreate=false -Dstorage.makeFullCheckpointAfterCreate=false
<argLine>-ea -Xmx2048m -Dindex.flushAfterCreate=false -Dstorage.makeFullCheckpointAfterCreate=false -Dstorage.makeFullCheckpointAfterOpen=false
-Dstorage.makeFullCheckpointAfterClusterCreate=false -Dstorage.wal.syncOnPageFlush=false
-Dstorage.configuration.syncOnUpdate=false
</argLine>
Expand Down
Expand Up @@ -113,7 +113,9 @@ public enum OGlobalConfiguration {

WAL_LOCATION("storage.wal.path", "Path to the wal file on the disk, by default is placed in DB directory but" + " it is highly recomended to use separate disk to store log operations", String.class, null),

STORAGE_MAKE_FULL_CHECKPOINT_AFTER_CREATE("storage.makeFullCheckpointAfterCreate", "Indicates whether full checkpoint should be performed if storage was opened.", Boolean.class, true),
STORAGE_MAKE_FULL_CHECKPOINT_AFTER_CREATE("storage.makeFullCheckpointAfterCreate", "Indicates whether full checkpoint should be performed if storage was created.", Boolean.class, true),

STORAGE_MAKE_FULL_CHECKPOINT_AFTER_OPEN("storage.makeFullCheckpointAfterOpen", "Indicates whether full checkpoint should be performed if storage was opened. It is needed to make fuzzy checkpoints to work without issues", Boolean.class, true),

STORAGE_MAKE_FULL_CHECKPOINT_AFTER_CLUSTER_CREATE("storage.makeFullCheckpointAfterClusterCreate", "Indicates whether full checkpoint should be performed if storage was opened.", Boolean.class, true),

Expand Down
Expand Up @@ -200,9 +200,10 @@ public void open(final String iUserName, final String iUserPassword, final Map<S
}

restoreIfNeeded();
if (OGlobalConfiguration.STORAGE_MAKE_FULL_CHECKPOINT_AFTER_OPEN.getValueAsBoolean())
makeFullCheckpoint();

clearStorageDirty();
diskCache.startFuzzyCheckpoints();
diskCache.startFuzzyCheckpoints();

status = STATUS.OPEN;
} catch (Exception e) {
Expand Down Expand Up @@ -263,7 +264,7 @@ public void create(final Map<String, Object> iProperties) {
if (OGlobalConfiguration.STORAGE_MAKE_FULL_CHECKPOINT_AFTER_CREATE.getValueAsBoolean())
makeFullCheckpoint();

diskCache.startFuzzyCheckpoints();
diskCache.startFuzzyCheckpoints();
postCreateSteps();

} catch (OStorageException e) {
Expand Down Expand Up @@ -1555,7 +1556,6 @@ private void restoreIfNeeded() throws Exception {
OLogManager.instance().warn(this, "Storage " + name + " was not closed properly. Will try to restore from write ahead log.");
try {
wereDataRestoredAfterOpen = restoreFromWAL();
makeFullCheckpoint();
} catch (Exception e) {
OLogManager.instance().error(this, "Exception during storage data restore.", e);
throw e;
Expand Down Expand Up @@ -2444,9 +2444,9 @@ private void rollbackAllUnfinishedWALOperations(Map<OOperationUnitId, List<OLogS
continue;

final OOperationUnitRecord atomicOperationRecord = (OOperationUnitRecord) writeAheadLog.read(operationUnit.get(0));
if (atomicOperationRecord == null) {
writeAheadLog.read(operationUnit.get(0));
}
if (atomicOperationRecord == null) {
writeAheadLog.read(operationUnit.get(0));
}
final OAtomicUnitStartRecord startRecord;

if (atomicOperationRecord instanceof OAtomicUnitStartRecord)
Expand Down
2 changes: 1 addition & 1 deletion distributed/pom.xml
Expand Up @@ -124,7 +124,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<argLine>-ea -Xmx2048m -Dindex.flushAfterCreate=false -Dstorage.makeFullCheckpointAfterCreate=false
<argLine>-ea -Xmx2048m -Dindex.flushAfterCreate=false -Dstorage.makeFullCheckpointAfterCreate=false -Dstorage.makeFullCheckpointAfterOpen=false
-Dstorage.makeFullCheckpointAfterClusterCreate=false -Dstorage.wal.syncOnPageFlush=false
-Dstorage.configuration.syncOnUpdate=false
</argLine>
Expand Down
1 change: 1 addition & 0 deletions graphdb/pom.xml
Expand Up @@ -131,6 +131,7 @@
<configuration>
<argLine>-ea -Xmx3G -Xss2048k -Dindex.flushAfterCreate=false
-Dstorage.makeFullCheckpointAfterCreate=false
-Dstorage.makeFullCheckpointAfterOpen=false
-Dstorage.makeFullCheckpointAfterClusterCreate=false -Dstorage.wal.syncOnPageFlush=false
-Dstorage.configuration.syncOnUpdate=false
</argLine>
Expand Down
2 changes: 1 addition & 1 deletion object/pom.xml
Expand Up @@ -95,7 +95,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<argLine>-ea -Xmx2048m -Dstorage.makeFullCheckpointAfterCreate=false
<argLine>-ea -Xmx2048m -Dstorage.makeFullCheckpointAfterCreate=false -Dstorage.makeFullCheckpointAfterOpen=false
-Dstorage.makeFullCheckpointAfterClusterCreate=false -Dstorage.wal.syncOnPageFlush=false
-Dstorage.configuration.syncOnUpdate=false
</argLine>
Expand Down
5 changes: 3 additions & 2 deletions tests/build.xml
Expand Up @@ -78,6 +78,7 @@
<jvmarg value="-DORIENTDB_NODE_NAME="/>
<jvmarg value="-Dstorage.lockTimeout=60000"/>
<jvmarg value="-Dstorage.makeFullCheckpointAfterCreate=false"/>
<jvmarg value="-Dstorage.makeFullCheckpointAfterOpen=false"/>
<jvmarg value="-Dstorage.makeFullCheckpointAfterClusterCreate=false"/>
<jvmarg value="-Dstorage.wal.syncOnPageFlush=false"/>
<jvmarg value="-Dstorage.configuration.syncOnUpdate=false"/>
Expand Down Expand Up @@ -120,11 +121,11 @@
<condition property="serializer" value="-Ddb.document.serializer=${db.document.serializer}" else="-Dnone=none">
<isset property="db.document.serializer" />
</condition>

<condition property="spareSerailizer" value="-Ddb.document.serializer=ORecordSerializerBinary" else="-Dnone=none">
<isset property="spareSerialization" />
</condition>

<echo>STARTING REMOTE ORIENTDB SERVER INSTANCE...</echo>
<exec dir="${orient.path}/bin" executable="cmd" spawn="true" osfamily="windows">
<env key="JAVA_OPTS"
Expand Down

0 comments on commit 1dbe7d4

Please sign in to comment.