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 @@ -2956,6 +2956,14 @@ public void testRestoreShardFromRemoteStore(boolean performFlush) throws IOExcep
2956
2956
)
2957
2957
);
2958
2958
2959
+ // Make sure to drain refreshes from the shard. Otherwise, if the refresh is in-progress, it overlaps with
2960
+ // deletion of segment files in the subsequent code block.
2961
+ for (ReferenceManager .RefreshListener refreshListener : target .getEngine ().config ().getInternalRefreshListener ()) {
2962
+ if (refreshListener instanceof ReleasableRetryableRefreshListener ) {
2963
+ ((ReleasableRetryableRefreshListener ) refreshListener ).drainRefreshes ();
2964
+ }
2965
+ }
2966
+
2959
2967
// Delete files in store directory to restore from remote directory
2960
2968
Directory storeDirectory = target .store ().directory ();
2961
2969
You can’t perform that action at this time.
0 commit comments