Skip to content

Commit 03ffdba

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 d91ad4e commit 03ffdba

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
@@ -2603,7 +2603,11 @@ public void testSnapshotSucceedsAfterSnapshotFailure() throws Exception {
26032603
.put("random", randomAsciiOfLength(10))));
26042604

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

0 commit comments

Comments
 (0)