Skip to content

Commit

Permalink
Fix bug where timer would not be stopped if replica did not fetch any…
Browse files Browse the repository at this point in the history
… segments.

This can happen when there is a new checkpoint published because of a SegmentInfos bump,
but the replica does not need to fetch any files.

Signed-off-by: Marc Handalian <handalm@amazon.com>
  • Loading branch information
mch2 committed Mar 3, 2023
1 parent 3a135e9 commit 3997594
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ void startSegmentCopy(GetSegmentFilesRequest request, ActionListener<GetSegmentF
}
});
if (request.getFilesToFetch().isEmpty()) {
// before completion, alert the primary of the replica's state.
handler.getCopyState().getShard().updateVisibleCheckpointForShard(request.getTargetAllocationId(), handler.getCopyState().getCheckpoint());
wrappedListener.onResponse(new GetSegmentFilesResponse(Collections.emptyList()));
} else {
handler.sendFiles(request, wrappedListener);
Expand Down

0 comments on commit 3997594

Please sign in to comment.