Skip to content

Commit ed8756b

Browse files
committed
Revert "No logging for impossible case"
This reverts commit f34d42a.
1 parent f34d42a commit ed8756b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,14 +939,20 @@ 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 && clusterStateShardStatus.state().completed() == false) {
942+
if (clusterStateShardStatus == null) {
943+
CONSISTENCY_CHECKER_LOGGER.debug(
944+
"shard [{}] in snapshot [{}] unexpectedly not found (should be impossible)",
945+
shardId,
946+
snapshot
947+
);
948+
} else if (clusterStateShardStatus.state().completed() == false) {
943949
CONSISTENCY_CHECKER_LOGGER.debug(
944950
"shard [{}] in snapshot [{}] unexpectedly still in state [{}] after notifying master",
945951
shardId,
946952
snapshot,
947953
clusterStateShardStatus
948954
);
949-
} // else shard is marked complete as expected (the null case should be impossible)
955+
} // else shard is marked complete as expected
950956
}
951957
} // else snapshot already completed & removed from cluster state
952958
}

0 commit comments

Comments
 (0)