Skip to content

Commit 19683eb

Browse files
committed
assert
1 parent 4901c6a commit 19683eb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/src/main/java/org/elasticsearch/index/shard/IndexShard.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ public void prepareForIndexRecovery() {
19011901
throw new IndexShardNotRecoveringException(shardId, state);
19021902
}
19031903
recoveryState.setStage(RecoveryState.Stage.INDEX);
1904-
assert getEngineOrNull() == null;
1904+
assert currentEngine.get() == null;
19051905
}
19061906

19071907
/**
@@ -2214,7 +2214,7 @@ private void innerOpenEngineAndTranslog(LongSupplier globalCheckpointSupplier) t
22142214
+ "] but got "
22152215
+ getRetentionLeases();
22162216
synchronized (engineMutex) {
2217-
assert getEngineOrNull() == null : "engine is running";
2217+
assert currentEngine.get() == null : "engine is running";
22182218
verifyNotClosed();
22192219
// we must create a new engine under mutex (see IndexShard#snapshotStoreMetadata).
22202220
final Engine newEngine = createEngine(config);
@@ -2311,7 +2311,7 @@ public void performRecoveryRestart() throws IOException {
23112311
*/
23122312
public void resetRecoveryStage() {
23132313
assert routingEntry().recoverySource().getType() == RecoverySource.Type.PEER : "not a peer recovery [" + routingEntry() + "]";
2314-
assert getEngineOrNull() == null;
2314+
assert currentEngine.get() == null;
23152315
if (state != IndexShardState.RECOVERING) {
23162316
throw new IndexShardNotRecoveringException(shardId, state);
23172317
}

0 commit comments

Comments
 (0)