Skip to content

Commit 1b99294

Browse files
Harsh-87jainankitk
authored andcommitted
[Auto Force Merge] Async task initialization fix (opensearch-project#19197)
Signed-off-by: Harsh Kothari <techarsh@amazon.com> Signed-off-by: Ankit Jain <jainankitk@apache.org>
1 parent 1873e4f commit 1b99294

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/src/main/java/org/opensearch/index/autoforcemerge/AutoForceMergeManager.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ public class AutoForceMergeManager extends AbstractLifecycleComponent {
6262
private final JvmService jvmService;
6363
private final IndicesService indicesService;
6464
private final ClusterService clusterService;
65-
private final AsyncForceMergeTask task;
65+
private AsyncForceMergeTask task;
6666
private ConfigurationValidator configurationValidator;
6767
private NodeValidator nodeValidator;
6868
private ShardValidator shardValidator;
6969
private Integer allocatedProcessors;
7070
private ResourceTrackerProvider.ResourceTrackers resourceTrackers;
71-
private final ForceMergeManagerSettings forceMergeManagerSettings;
71+
private ForceMergeManagerSettings forceMergeManagerSettings;
7272
private final CommonStatsFlags flags = new CommonStatsFlags(CommonStatsFlags.Flag.Segments, CommonStatsFlags.Flag.Translog);
7373
private final Set<Integer> mergingShards;
7474

@@ -86,13 +86,13 @@ public AutoForceMergeManager(
8686
this.jvmService = monitorService.jvmService();
8787
this.clusterService = clusterService;
8888
this.indicesService = indicesService;
89-
this.forceMergeManagerSettings = new ForceMergeManagerSettings(clusterService, this::modifySchedulerInterval);
90-
this.task = new AsyncForceMergeTask();
9189
this.mergingShards = new HashSet<>();
9290
}
9391

9492
@Override
9593
protected void doStart() {
94+
this.forceMergeManagerSettings = new ForceMergeManagerSettings(clusterService, this::modifySchedulerInterval);
95+
this.task = new AsyncForceMergeTask();
9696
this.configurationValidator = new ConfigurationValidator();
9797
this.nodeValidator = new NodeValidator();
9898
this.shardValidator = new ShardValidator();

0 commit comments

Comments
 (0)