File tree 1 file changed +8
-0
lines changed
server/src/test/java/org/opensearch/index/shard
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -2894,6 +2894,14 @@ public void testRestoreShardFromRemoteStore(boolean performFlush) throws IOExcep
2894
2894
)
2895
2895
);
2896
2896
2897
+ // Make sure to drain refreshes from the shard. Otherwise, if the refresh is in-progress, it overlaps with
2898
+ // deletion of segment files in the subsequent code block.
2899
+ for (ReferenceManager .RefreshListener refreshListener : target .getEngine ().config ().getInternalRefreshListener ()) {
2900
+ if (refreshListener instanceof ReleasableRetryableRefreshListener ) {
2901
+ ((ReleasableRetryableRefreshListener ) refreshListener ).drainRefreshes ();
2902
+ }
2903
+ }
2904
+
2897
2905
// Delete files in store directory to restore from remote directory
2898
2906
Directory storeDirectory = target .store ().directory ();
2899
2907
You can’t perform that action at this time.
0 commit comments