Skip to content

Commit bb682e1

Browse files
committed
feedback
1 parent 132752f commit bb682e1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3061,7 +3061,7 @@ public void maybeSyncGlobalCheckpoint(final String reason) {
30613061
}
30623062
assert assertPrimaryMode();
30633063
// only sync if there are no operations in flight, or when using async durability
3064-
final SeqNoStats stats = getEngine().getSeqNoStats(replicationTracker.getGlobalCheckpoint());
3064+
final SeqNoStats stats = seqNoStats();
30653065
final boolean asyncDurability = indexSettings().getTranslogDurability() == Translog.Durability.ASYNC;
30663066
if (stats.getMaxSeqNo() == stats.getGlobalCheckpoint() || asyncDurability) {
30673067
final var trackedGlobalCheckpointsNeedSync = replicationTracker.trackedGlobalCheckpointsNeedSync();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Index getIndex() {
4040
}
4141

4242
long maxSeqNo() {
43-
return shard.getEngine().getSeqNoStats(-1).getMaxSeqNo();
43+
return shard.withEngine(engine -> engine.getSeqNoStats(-1)).getMaxSeqNo();
4444
}
4545

4646
long maxUnsafeAutoIdTimestamp() {

0 commit comments

Comments
 (0)