Remove global checkpoint assertion in peer recovery (#41987)
If remote recovery copies an index commit which has gaps in sequence numbers to a follower; then these assertions (introduced in #40823) don't hold for follower replicas. Closes #41037
This commit is contained in:
parent
febee07dcc
commit
c19ea0a6f1
|
@ -39,7 +39,6 @@ import org.elasticsearch.index.engine.Engine;
|
|||
import org.elasticsearch.index.mapper.MapperException;
|
||||
import org.elasticsearch.index.seqno.ReplicationTracker;
|
||||
import org.elasticsearch.index.seqno.RetentionLeases;
|
||||
import org.elasticsearch.index.seqno.SequenceNumbers;
|
||||
import org.elasticsearch.index.shard.IndexShard;
|
||||
import org.elasticsearch.index.shard.IndexShardNotRecoveringException;
|
||||
import org.elasticsearch.index.shard.IndexShardState;
|
||||
|
@ -288,9 +287,6 @@ public class RecoveryTarget extends AbstractRefCounted implements RecoveryTarget
|
|||
ActionListener.completeWith(listener, () -> {
|
||||
state().getTranslog().totalOperations(totalTranslogOps);
|
||||
indexShard().openEngineAndSkipTranslogRecovery();
|
||||
assert indexShard.getGlobalCheckpoint() >= indexShard.seqNoStats().getMaxSeqNo() ||
|
||||
indexShard.indexSettings().getIndexVersionCreated().before(Version.V_7_2_0)
|
||||
: "global checkpoint is not initialized [" + indexShard.seqNoStats() + "]";
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
@ -399,9 +395,6 @@ public class RecoveryTarget extends AbstractRefCounted implements RecoveryTarget
|
|||
if (indexShard.indexSettings().getIndexVersionCreated().before(Version.V_6_0_0_rc1)) {
|
||||
store.ensureIndexHasHistoryUUID();
|
||||
}
|
||||
assert globalCheckpoint >= Long.parseLong(sourceMetaData.getCommitUserData().get(SequenceNumbers.MAX_SEQ_NO))
|
||||
|| indexShard.indexSettings().getIndexVersionCreated().before(Version.V_7_2_0) :
|
||||
"invalid global checkpoint[" + globalCheckpoint + "] source_meta_data [" + sourceMetaData.getCommitUserData() + "]";
|
||||
final String translogUUID = Translog.createEmptyTranslog(
|
||||
indexShard.shardPath().resolveTranslog(), globalCheckpoint, shardId, indexShard.getPendingPrimaryTerm());
|
||||
store.associateIndexWithNewTranslog(translogUUID);
|
||||
|
|
Loading…
Reference in New Issue