Skip to content

Commit

Permalink
Remove shallow v2 snapshots from current snapshots altogether
Browse files Browse the repository at this point in the history
Signed-off-by: Lakshya Taragi <lakshya.taragi@gmail.com>
  • Loading branch information
ltaragi committed Oct 21, 2024
1 parent 2719b75 commit ef2af69
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ protected void clusterManagerOperation(
request.repository(),
Arrays.asList(request.snapshots())
);
// remove entries of shallow-v2 snapshots
currentSnapshots.removeIf(SnapshotsInProgress.Entry::remoteStoreIndexShallowCopyV2);
if (currentSnapshots.isEmpty()) {
buildResponse(snapshotsInProgress, request, currentSnapshots, null, listener);
return;
Expand Down Expand Up @@ -236,7 +238,7 @@ private Set<String> getNodeIdsOfCurrentSnapshots(final SnapshotsStatusRequest re
);
}
// the actual no. of shards contributed by this current snapshot will now be calculated
} else if (currentSnapshotEntry.remoteStoreIndexShallowCopyV2() == false) {
} else {
// all shards of this current snapshot are required in response
totalShardsAcrossCurrentSnapshots += currentSnapshotEntry.shards().size();
}
Expand All @@ -246,7 +248,7 @@ private Set<String> getNodeIdsOfCurrentSnapshots(final SnapshotsStatusRequest re
SnapshotsInProgress.ShardSnapshotStatus shardStatus = shardStatusEntry.getValue();
boolean indexPresentInFilter = requestedIndexNames.contains(shardStatusEntry.getKey().getIndexName());

if (requestUsesIndexFilter && indexPresentInFilter && currentSnapshotEntry.remoteStoreIndexShallowCopyV2() == false) {
if (requestUsesIndexFilter && indexPresentInFilter) {
// count only those shards whose index belongs to the index-filter
totalShardsAcrossCurrentSnapshots++;

Expand Down

0 comments on commit ef2af69

Please sign in to comment.