Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,7 @@ public CommitStats commitStats() {
* @throws AlreadyClosedException if shard is closed
*/
public SeqNoStats seqNoStats() {
return getEngine().getSeqNoStats(replicationTracker.getGlobalCheckpoint());
return withEngine(engine -> engine.getSeqNoStats(getLastKnownGlobalCheckpoint()));
}

public IndexingStats indexingStats() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,13 @@ protected void asyncShardOperation(final Request request, final ShardId shardId,
throws IOException {
final IndexService indexService = indicesService.indexServiceSafe(request.getShard().getIndex());
final IndexShard indexShard = indexService.getShard(request.getShard().id());
final SeqNoStats seqNoStats = indexShard.seqNoStats();
final long lastKnownGlobalCheckpoint = indexShard.getLastKnownGlobalCheckpoint();

if (request.getFromSeqNo() > seqNoStats.getGlobalCheckpoint()) {
if (request.getFromSeqNo() > lastKnownGlobalCheckpoint) {
logger.trace(
"{} waiting for global checkpoint advancement from [{}] to [{}]",
shardId,
seqNoStats.getGlobalCheckpoint(),
lastKnownGlobalCheckpoint,
request.getFromSeqNo()
);
indexShard.addGlobalCheckpointListener(request.getFromSeqNo(), new GlobalCheckpointListeners.GlobalCheckpointListener() {
Expand Down