Skip to content

Commit

Permalink
Print out state of index if didn't recover from the snapshot (elastic…
Browse files Browse the repository at this point in the history
…#106726)

Add additional debug information about the index and its recovery state
if the assertion for `recoveredFromSnapshotBytes` fails

See elastic#87568
  • Loading branch information
arteam authored Mar 26, 2024
1 parent 829ea4d commit daf46b5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,11 @@ public void testRecoveryConcurrentlyWithIndexing() throws Exception {
if (waitForSnapshotDownloadToStart) {
// must complete using snapshots alone.
RecoveryState recoveryState = getLatestPeerRecoveryStateForShard(indexName, 0);
assertThat(recoveryState.getIndex().recoveredFromSnapshotBytes(), equalTo(snapshotSizeForIndex));
assertThat(
"Index " + recoveryState.getIndex() + " should be completely recovered from the snapshot",
recoveryState.getIndex().recoveredFromSnapshotBytes(),
equalTo(snapshotSizeForIndex)
);
}

assertDocumentsAreEqual(indexName, numDocs.get());
Expand Down

0 comments on commit daf46b5

Please sign in to comment.