Skip to content

Commit ef2af69

Browse files
committed
Remove shallow v2 snapshots from current snapshots altogether
Signed-off-by: Lakshya Taragi <lakshya.taragi@gmail.com>
1 parent 2719b75 commit ef2af69

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ protected void clusterManagerOperation(
159159
request.repository(),
160160
Arrays.asList(request.snapshots())
161161
);
162+
// remove entries of shallow-v2 snapshots
163+
currentSnapshots.removeIf(SnapshotsInProgress.Entry::remoteStoreIndexShallowCopyV2);
162164
if (currentSnapshots.isEmpty()) {
163165
buildResponse(snapshotsInProgress, request, currentSnapshots, null, listener);
164166
return;
@@ -236,7 +238,7 @@ private Set<String> getNodeIdsOfCurrentSnapshots(final SnapshotsStatusRequest re
236238
);
237239
}
238240
// the actual no. of shards contributed by this current snapshot will now be calculated
239-
} else if (currentSnapshotEntry.remoteStoreIndexShallowCopyV2() == false) {
241+
} else {
240242
// all shards of this current snapshot are required in response
241243
totalShardsAcrossCurrentSnapshots += currentSnapshotEntry.shards().size();
242244
}
@@ -246,7 +248,7 @@ private Set<String> getNodeIdsOfCurrentSnapshots(final SnapshotsStatusRequest re
246248
SnapshotsInProgress.ShardSnapshotStatus shardStatus = shardStatusEntry.getValue();
247249
boolean indexPresentInFilter = requestedIndexNames.contains(shardStatusEntry.getKey().getIndexName());
248250

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

0 commit comments

Comments
 (0)