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) {
|
if (skipInitialTranslogRecovery) {
|
||||||
// make sure we point at the latest translog from now on..
|
// make sure we point at the latest translog from now on..
|
||||||
commitIndexWriter(writer, translog.currentId());
|
commitIndexWriter(writer, translog.currentId());
|
||||||
translog.markCommitted(translog.currentId());
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
recoverFromTranslog(engineConfig, committedTranslogId);
|
recoverFromTranslog(engineConfig, committedTranslogId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,6 +126,7 @@ public class IndexShardSnapshotAndRestoreService extends AbstractIndexShardCompo
|
||||||
}
|
}
|
||||||
indexShardRepository.restore(restoreSource.snapshotId(), shardId, snapshotShardId, recoveryState);
|
indexShardRepository.restore(restoreSource.snapshotId(), shardId, snapshotShardId, recoveryState);
|
||||||
indexShard.skipTranslogRecovery();
|
indexShard.skipTranslogRecovery();
|
||||||
|
indexShard.translog().markCommitted(indexShard.translog().currentId());
|
||||||
indexShard.finalizeRecovery();
|
indexShard.finalizeRecovery();
|
||||||
indexShard.postRecovery("restore done");
|
indexShard.postRecovery("restore done");
|
||||||
restoreService.indexShardRestoreCompleted(restoreSource.snapshotId(), shardId);
|
restoreService.indexShardRestoreCompleted(restoreSource.snapshotId(), shardId);
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
package org.elasticsearch.index;
|
package org.elasticsearch.index;
|
||||||
|
|
||||||
import com.carrotsearch.randomizedtesting.annotations.Repeat;
|
|
||||||
import org.elasticsearch.ElasticsearchException;
|
import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
|
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
|
||||||
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
|
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
|
||||||
|
|
Loading…
Reference in New Issue