Skip to content

Commit 4de42a6

Browse files
authored
Failure message in assertGenerationConsistency (#108908)
If this assertion trips it would be useful to report these details. Relates #108907
1 parent 26b1ea8 commit 4de42a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ private static boolean assertGenerationConsistency(
9797
@Nullable ShardGeneration activeGeneration
9898
) {
9999
final ShardGeneration bestGeneration = generations.getOrDefault(indexName, Collections.emptyMap()).get(shardId);
100-
assert bestGeneration == null || activeGeneration == null || activeGeneration.equals(bestGeneration);
100+
assert bestGeneration == null || activeGeneration == null || activeGeneration.equals(bestGeneration)
101+
: "[" + indexName + "][" + shardId + "]: " + bestGeneration + " vs " + activeGeneration;
101102
return true;
102103
}
103104

0 commit comments

Comments
 (0)