diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java index 04e7978adf9dd..365ab62a2edea 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java @@ -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; @@ -236,7 +238,7 @@ private Set 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(); } @@ -246,7 +248,7 @@ private Set 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++;