Skip to content

Commit

Permalink
Reenable+Fix testMasterShutdownDuringFailedSnapshot (#46303) (#46747)
Browse files Browse the repository at this point in the history
Reenable this test since it was fixed by #45689 in production
code (specifically, the fact that we write the `snap-` blobs
without overwrite checks now).
Only required adding the assumed blocking on index file writes
to test code to properly work again.

* Closes #25281
  • Loading branch information
original-brownbear authored Sep 17, 2019
1 parent b00de8e commit 2c70d40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,6 @@ public void testMasterAndDataShutdownDuringSnapshot() throws Exception {
}
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/25281")
public void testMasterShutdownDuringFailedSnapshot() throws Exception {
logger.info("--> starting two master nodes and two data nodes");
internalCluster().startMasterOnlyNodes(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ public void writeBlob(String blobName, InputStream inputStream, long blobSize, b
public void writeBlobAtomic(final String blobName, final InputStream inputStream, final long blobSize,
final boolean failIfAlreadyExists) throws IOException {
final Random random = RandomizedContext.current().getRandom();
if (blobName.startsWith("index-") && blockOnWriteIndexFile) {
blockExecutionAndFail(blobName);
}
if ((delegate() instanceof FsBlobContainer) && (random.nextBoolean())) {
// Simulate a failure between the write and move operation in FsBlobContainer
final String tempBlobName = FsBlobContainer.tempBlobName(blobName);
Expand Down

0 comments on commit 2c70d40

Please sign in to comment.