Skip to content

Commit 989e4fe

Browse files
author
Himshikha Gupta
committed
changing thread pool
Signed-off-by: Himshikha Gupta <himshikh@amazon.com>
1 parent 93f9a43 commit 989e4fe

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

server/src/main/java/org/opensearch/gateway/remote/ClusterStateChecksum.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
*/
4444
public class ClusterStateChecksum implements ToXContentFragment, Writeable {
4545

46+
public static final int COMPONENT_SIZE = 11;
4647
static final String ROUTING_TABLE_CS = "routing_table";
4748
static final String NODES_CS = "discovery_nodes";
4849
static final String BLOCKS_CS = "blocks";
@@ -56,7 +57,6 @@ public class ClusterStateChecksum implements ToXContentFragment, Writeable {
5657
static final String INDICES_CS = "indices_md";
5758
private static final String CLUSTER_STATE_CS = "cluster_state";
5859
private static final int CHECKSUM_SIZE = 8;
59-
private static final int COMPONENT_SIZE = 11;
6060
private static final Logger logger = LogManager.getLogger(ClusterStateChecksum.class);
6161

6262
long routingTableChecksum;

server/src/main/java/org/opensearch/threadpool/ThreadPool.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import org.opensearch.core.service.ReportingService;
5454
import org.opensearch.core.xcontent.ToXContentFragment;
5555
import org.opensearch.core.xcontent.XContentBuilder;
56+
import org.opensearch.gateway.remote.ClusterStateChecksum;
5657
import org.opensearch.node.Node;
5758

5859
import java.io.IOException;
@@ -192,7 +193,7 @@ public static ThreadPoolType fromType(String type) {
192193
map.put(Names.REMOTE_RECOVERY, ThreadPoolType.SCALING);
193194
map.put(Names.REMOTE_STATE_READ, ThreadPoolType.SCALING);
194195
map.put(Names.INDEX_SEARCHER, ThreadPoolType.RESIZABLE);
195-
map.put(Names.REMOTE_STATE_CHECKSUM, ThreadPoolType.SCALING);
196+
map.put(Names.REMOTE_STATE_CHECKSUM, ThreadPoolType.FIXED);
196197
THREAD_POOL_TYPES = Collections.unmodifiableMap(map);
197198
}
198199

@@ -311,12 +312,7 @@ public ThreadPool(
311312
);
312313
builders.put(
313314
Names.REMOTE_STATE_CHECKSUM,
314-
new ScalingExecutorBuilder(
315-
Names.REMOTE_STATE_CHECKSUM,
316-
1,
317-
twiceAllocatedProcessors(allocatedProcessors),
318-
TimeValue.timeValueMinutes(5)
319-
)
315+
new FixedExecutorBuilder(settings, Names.REMOTE_STATE_CHECKSUM, ClusterStateChecksum.COMPONENT_SIZE, 1000)
320316
);
321317

322318
for (final ExecutorBuilder<?> builder : customBuilders) {

server/src/test/java/org/opensearch/threadpool/ScalingThreadPoolTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ private int expectedSize(final String threadPoolName, final int numberOfProcesso
157157
sizes.put(ThreadPool.Names.REMOTE_REFRESH_RETRY, ThreadPool::halfAllocatedProcessors);
158158
sizes.put(ThreadPool.Names.REMOTE_RECOVERY, ThreadPool::twiceAllocatedProcessors);
159159
sizes.put(ThreadPool.Names.REMOTE_STATE_READ, ThreadPool::twiceAllocatedProcessors);
160-
sizes.put(ThreadPool.Names.REMOTE_STATE_CHECKSUM, ThreadPool::twiceAllocatedProcessors);
161160
return sizes.get(threadPoolName).apply(numberOfProcessors);
162161
}
163162

0 commit comments

Comments
 (0)