Fix testRetentionLeasesClearedOnRestore (#44754) (#44766)

* Fix this test randomly failing when running into async translog persistence edge case and failing to successfully close index
* Also, slightly improve debug logging on close failure
* Closes #44681
This commit is contained in:
Armin Braun 2019-07-23 21:29:07 +02:00 committed by GitHub
parent 9338fc8536
commit 818103ff1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -442,7 +442,7 @@ public class MetaDataIndexStateService {
final boolean acknowledged = result.getValue().hasFailures() == false;
try {
if (acknowledged == false) {
logger.debug("verification of shards before closing {} failed", index);
logger.debug("verification of shards before closing {} failed [{}]", index, result);
continue;
}
final IndexMetaData indexMetaData = metadata.getSafe(index);

View File

@ -311,6 +311,8 @@ public abstract class ESBlobStoreRepositoryIntegTestCase extends ESIntegTestCase
addRandomDocuments(indexName, extraDocCount);
}
// Wait for green so the close does not fail in the edge case of coinciding with a shard recovery that hasn't fully synced yet
ensureGreen();
logger.info("--> close index {}", indexName);
assertAcked(client().admin().indices().prepareClose(indexName));