Skip to content

Do not perform cleanup if Manifest write fails with dirty exception #40519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,14 @@ long writeManifestAndCleanup(String reason, Manifest manifest) throws WriteState
finished = true;
return generation;
} catch (WriteStateException e) {
rollback();
// if Manifest write results in dirty WriteStateException it's not safe to remove
// new metadata files, because if Manifest was actually written to disk and its deletion
// fails it will reference these new metadata files.
// In the future, we might decide to add more fine grained check to understand if after
// WriteStateException Manifest deletion has actually failed.
if (e.isDirty() == false) {
rollback();
}
throw e;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@ private static MetaData randomMetaDataForTx() {
return builder.build();
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/39077")
public void testAtomicityWithFailures() throws IOException {
try (NodeEnvironment env = newNodeEnvironment()) {
MetaStateServiceWithFailures metaStateService =
Expand Down