Reenable+Fix testMasterShutdownDuringFailedSnapshot (#46303) (#46747)

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
This commit is contained in:
Armin Braun 2019-09-17 18:09:48 +02:00 committed by GitHub
parent b00de8edf3
commit 2c70d403fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -933,7 +933,6 @@ public class DedicatedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTest
} }
} }
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/25281")
public void testMasterShutdownDuringFailedSnapshot() throws Exception { public void testMasterShutdownDuringFailedSnapshot() throws Exception {
logger.info("--> starting two master nodes and two data nodes"); logger.info("--> starting two master nodes and two data nodes");
internalCluster().startMasterOnlyNodes(2); internalCluster().startMasterOnlyNodes(2);

View File

@ -369,6 +369,9 @@ public class MockRepository extends FsRepository {
public void writeBlobAtomic(final String blobName, final InputStream inputStream, final long blobSize, public void writeBlobAtomic(final String blobName, final InputStream inputStream, final long blobSize,
final boolean failIfAlreadyExists) throws IOException { final boolean failIfAlreadyExists) throws IOException {
final Random random = RandomizedContext.current().getRandom(); final Random random = RandomizedContext.current().getRandom();
if (blobName.startsWith("index-") && blockOnWriteIndexFile) {
blockExecutionAndFail(blobName);
}
if ((delegate() instanceof FsBlobContainer) && (random.nextBoolean())) { if ((delegate() instanceof FsBlobContainer) && (random.nextBoolean())) {
// Simulate a failure between the write and move operation in FsBlobContainer // Simulate a failure between the write and move operation in FsBlobContainer
final String tempBlobName = FsBlobContainer.tempBlobName(blobName); final String tempBlobName = FsBlobContainer.tempBlobName(blobName);