Skip to content

Commit 5f1d108

Browse files
author
Ali Beyad
committed
[TEST] reduce the number of snapshotted shards to 1 in testSnapshotSucceedsAfterSnapshotFailure()
so that we are more likely to trigger I/O exceptions on writing the control files during the finalize phase of snapshotting (with the aim of triggering an I/O failure when writing pending-index-*).
1 parent 5336e72 commit 5f1d108

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/src/test/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2683,7 +2683,11 @@ public void testSnapshotSucceedsAfterSnapshotFailure() throws Exception {
26832683
.put("random", randomAsciiOfLength(10))));
26842684

26852685
logger.info("--> indexing some data");
2686-
createIndex("test-idx");
2686+
assertAcked(prepareCreate("test-idx").setSettings(
2687+
// the less the number of shards, the less control files we have, so we are giving a higher probability of
2688+
// triggering an IOException toward the end when writing the pending-index-* files, which are the files
2689+
// that caused problems with writing subsequent snapshots if they happened to be lingering in the repository
2690+
Settings.builder().put(SETTING_NUMBER_OF_SHARDS, 1).put(SETTING_NUMBER_OF_REPLICAS, 0)));
26872691
ensureGreen();
26882692
final int numDocs = randomIntBetween(1, 5);
26892693
for (int i = 0; i < numDocs; i++) {

0 commit comments

Comments
 (0)