Only mark translog committed in restore recovery

This commit is contained in:
Simon Willnauer 2015-05-04 21:39:17 +02:00
parent 930eacd457
commit 7e5c238998
3 changed files with 1 additions and 3 deletions

View File

@ -145,8 +145,6 @@ public class InternalEngine extends Engine {
if (skipInitialTranslogRecovery) {
// make sure we point at the latest translog from now on..
commitIndexWriter(writer, translog.currentId());
translog.markCommitted(translog.currentId());
} else {
recoverFromTranslog(engineConfig, committedTranslogId);
}

View File

@ -126,6 +126,7 @@ public class IndexShardSnapshotAndRestoreService extends AbstractIndexShardCompo
}
indexShardRepository.restore(restoreSource.snapshotId(), shardId, snapshotShardId, recoveryState);
indexShard.skipTranslogRecovery();
indexShard.translog().markCommitted(indexShard.translog().currentId());
indexShard.finalizeRecovery();
indexShard.postRecovery("restore done");
restoreService.indexShardRestoreCompleted(restoreSource.snapshotId(), shardId);

View File

@ -19,7 +19,6 @@
package org.elasticsearch.index;
import com.carrotsearch.randomizedtesting.annotations.Repeat;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;