mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-23 13:26:02 +00:00
Force flush in FrozenEngine#testSearchers (#51635)
We need to force flush to make the last commit safe; otherwise, we might fail to open FrozenEngine. Note that we force flush before closing a shard. Closes #51620
This commit is contained in:
parent
72c5bc9630
commit
1cba5d7c4b
@ -342,7 +342,9 @@ public class FrozenEngineTests extends EngineTestCase {
|
|||||||
applyOperations(engine, generateHistoryOnReplica(between(10, 1000), false, randomBoolean(), randomBoolean()));
|
applyOperations(engine, generateHistoryOnReplica(between(10, 1000), false, randomBoolean(), randomBoolean()));
|
||||||
globalCheckpoint.set(engine.getProcessedLocalCheckpoint());
|
globalCheckpoint.set(engine.getProcessedLocalCheckpoint());
|
||||||
engine.syncTranslog();
|
engine.syncTranslog();
|
||||||
engine.flush();
|
// We need to force flush to make the last commit a safe commit; otherwise, we might fail to open ReadOnlyEngine
|
||||||
|
// See TransportVerifyShardBeforeCloseAction#executeShardOperation
|
||||||
|
engine.flush(true, true);
|
||||||
engine.refresh("test");
|
engine.refresh("test");
|
||||||
try (Engine.Searcher searcher = engine.acquireSearcher("test")) {
|
try (Engine.Searcher searcher = engine.acquireSearcher("test")) {
|
||||||
totalDocs = searcher.search(new MatchAllDocsQuery(), Integer.MAX_VALUE).scoreDocs.length;
|
totalDocs = searcher.search(new MatchAllDocsQuery(), Integer.MAX_VALUE).scoreDocs.length;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user