Skip to content

Commit f34d42a

Browse files
committed
No logging for impossible case
1 parent 026979a commit f34d42a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

server/src/main/java/org/elasticsearch/snapshots/SnapshotShardsService.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -939,16 +939,14 @@ private void runCheck() {
939939
if (clusterStateSnapshotEntry != null) {
940940
for (final var shardId : snapshotShards.getValue()) {
941941
final var clusterStateShardStatus = clusterStateSnapshotEntry.shards().get(shardId);
942-
if (clusterStateShardStatus == null) {
943-
CONSISTENCY_CHECKER_LOGGER.debug("shard [{}] in snapshot [{}] unexpectedly not found", shardId, snapshot);
944-
} else if (clusterStateShardStatus.state().completed() == false) {
942+
if (clusterStateShardStatus != null && clusterStateShardStatus.state().completed() == false) {
945943
CONSISTENCY_CHECKER_LOGGER.debug(
946944
"shard [{}] in snapshot [{}] unexpectedly still in state [{}] after notifying master",
947945
shardId,
948946
snapshot,
949947
clusterStateShardStatus
950948
);
951-
} // else shard is marked complete as expected
949+
} // else shard is marked complete as expected (the null case should be impossible)
952950
}
953951
} // else snapshot already completed & removed from cluster state
954952
}

0 commit comments

Comments
 (0)