Only mark translog committed in restore recovery
This commit is contained in:
parent
930eacd457
commit
7e5c238998
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue