Skip to content

Commit

Permalink
Use clusterState entry of shallow v2 snapshot
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 8212d97 commit 0605e73
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,19 +236,21 @@ private Set<String> getNodeIdsOfCurrentSnapshots(final SnapshotsStatusRequest re
);
}
// the actual no. of shards contributed by this current snapshot will now be calculated
} else {
} else if (currentSnapshotEntry.remoteStoreIndexShallowCopyV2() == false) {
// all shards of this current snapshot are required in response
totalShardsAcrossCurrentSnapshots = currentSnapshotEntry.shards().size();
totalShardsAcrossCurrentSnapshots += currentSnapshotEntry.shards().size();
}

for (final Map.Entry<ShardId, SnapshotsInProgress.ShardSnapshotStatus> shardStatusEntry : currentSnapshotEntry.shards()
.entrySet()) {
SnapshotsInProgress.ShardSnapshotStatus shardStatus = shardStatusEntry.getValue();
boolean indexPresentInFilter = requestedIndexNames.contains(shardStatusEntry.getKey().getIndexName());

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

// for non-index filter case, we already counted all the shards of this current snapshot (non-shallow v2)
}

if (shardStatus.nodeId() != null) {
Expand Down

0 comments on commit 0605e73

Please sign in to comment.