Skip to content

Commit c12c2a6

Browse files
committed
Rename the bulk thread pool to write thread pool (#29593)
This commit renames the bulk thread pool to the write thread pool. This is to better reflect the fact that the underlying thread pool is used to execute any document write request (single-document index/delete/update requests, and bulk requests). With this change, we add support for fallback settings thread_pool.bulk.* which will be supported until 7.0.0. We also add a system property so that the display name of the thread pool remains as "bulk" if needed to avoid breaking users.
1 parent fa10520 commit c12c2a6

File tree

23 files changed

+162
-81
lines changed

23 files changed

+162
-81
lines changed

docs/reference/cat.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ Responds with:
9393
// TESTRESPONSE[s/9300 27 sLBaIGK/\\d+ \\d+ .+/ _cat]
9494

9595
You can also request multiple columns using simple wildcards like
96-
`/_cat/thread_pool?h=ip,bulk.*` to get all headers (or aliases) starting
97-
with `bulk.`.
96+
`/_cat/thread_pool?h=ip,queue*` to get all headers (or aliases) starting
97+
with `queue`.
9898

9999
[float]
100100
[[numeric-formats]]

docs/reference/cat/thread_pool.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Which looks like:
1515
[source,txt]
1616
--------------------------------------------------
1717
node-0 analyze 0 0 0
18-
node-0 bulk 0 0 0
1918
node-0 fetch_shard_started 0 0 0
2019
node-0 fetch_shard_store 0 0 0
2120
node-0 flush 0 0 0
@@ -28,6 +27,7 @@ node-0 refresh 0 0 0
2827
node-0 search 0 0 0
2928
node-0 snapshot 0 0 0
3029
node-0 warmer 0 0 0
30+
node-0 write 0 0 0
3131
--------------------------------------------------
3232
// TESTRESPONSE[s/\d+/\\d+/ _cat]
3333

@@ -44,7 +44,6 @@ The second column is the thread pool name
4444
--------------------------------------------------
4545
name
4646
analyze
47-
bulk
4847
fetch_shard_started
4948
fetch_shard_store
5049
flush
@@ -57,6 +56,7 @@ refresh
5756
search
5857
snapshot
5958
warmer
59+
write
6060
--------------------------------------------------
6161

6262

docs/reference/modules/threadpool.asciidoc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ There are several thread pools, but the important ones include:
2727
`analyze`::
2828
For analyze requests. Thread pool type is `fixed` with a size of 1, queue size of 16.
2929

30-
`bulk`::
31-
For bulk operations. Thread pool type is `fixed`
32-
with a size of `# of available processors`,
33-
queue_size of `200`. The maximum size for this pool
34-
is `1 + # of available processors`.
30+
`write`::
31+
For single-document index/delete/update and bulk requests. Thread pool type
32+
is `fixed` with a size of `# of available processors`, queue_size of `200`.
33+
The maximum size for this pool is `1 + # of available processors`.
3534

3635
`snapshot`::
3736
For snapshot/restore operations. Thread pool type is `scaling` with a

modules/reindex/src/test/java/org/elasticsearch/index/reindex/RetryTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ private void testCase(
158158

159159
final Settings nodeSettings = Settings.builder()
160160
// use pools of size 1 so we can block them
161-
.put("thread_pool.bulk.size", 1)
161+
.put("thread_pool.write.size", 1)
162162
.put("thread_pool.search.size", 1)
163163
// use queues of size 1 because size 0 is broken and because search requests need the queue to function
164-
.put("thread_pool.bulk.queue_size", 1)
164+
.put("thread_pool.write.queue_size", 1)
165165
.put("thread_pool.search.queue_size", 1)
166166
.put("node.attr.color", "blue")
167167
.build();
@@ -203,7 +203,7 @@ private void testCase(
203203
assertBusy(() -> assertThat(taskStatus(action).getSearchRetries(), greaterThan(0L)));
204204

205205
logger.info("Blocking bulk and unblocking search so we start to get bulk rejections");
206-
CyclicBarrier bulkBlock = blockExecutor(ThreadPool.Names.BULK, node);
206+
CyclicBarrier bulkBlock = blockExecutor(ThreadPool.Names.WRITE, node);
207207
initialSearchBlock.await();
208208

209209
logger.info("Waiting for bulk rejections");

rest-api-spec/src/main/resources/rest-api-spec/test/cat.thread_pool/10_basic.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
"Test cat thread_pool output":
3-
43
- skip:
54
version: " - 6.99.99"
65
reason: this API was changed in a backwards-incompatible fashion in 7.0.0 so we need to skip in a mixed cluster
@@ -33,29 +32,29 @@
3332
3433
- do:
3534
cat.thread_pool:
36-
thread_pool_patterns: bulk,management,flush,generic,force_merge
35+
thread_pool_patterns: write,management,flush,generic,force_merge
3736
h: id,name,active
3837
v: true
3938

4039
- match:
4140
$body: |
4241
/^ id \s+ name \s+ active \n
43-
(\S+\s+ bulk \s+ \d+ \n
44-
\S+\s+ flush \s+ \d+ \n
42+
(\S+\s+ flush \s+ \d+ \n
4543
\S+\s+ force_merge \s+ \d+ \n
4644
\S+\s+ generic \s+ \d+ \n
47-
\S+\s+ management \s+ \d+ \n)+ $/
45+
\S+\s+ management \s+ \d+ \n
46+
\S+\s+ write \s+ \d+ \n)+ $/
4847
4948
- do:
5049
cat.thread_pool:
51-
thread_pool_patterns: bulk
52-
h: id,name,type,active,pool_size,queue,queue_size,rejected,largest,completed,core,max,size,keep_alive
50+
thread_pool_patterns: write
51+
h: id,name,type,active,size,queue,queue_size,rejected,largest,completed,min,max,keep_alive
5352
v: true
5453

5554
- match:
5655
$body: |
57-
/^ id \s+ name \s+ type \s+ active \s+ pool_size \s+ queue \s+ queue_size \s+ rejected \s+ largest \s+ completed \s+ core \s+ max \s+ size \s+ keep_alive \n
58-
(\S+ \s+ bulk \s+ fixed \s+ \d+ \s+ \d+ \s+ \d+ \s+ (-1|\d+) \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \d* \s+ \S* \n)+ $/
56+
/^ id \s+ name \s+ type \s+ active \s+ size \s+ queue \s+ queue_size \s+ rejected \s+ largest \s+ completed \s+ max \s+ keep_alive \n
57+
(\S+ \s+ write \s+ fixed \s+ \d+ \s+ \d+ \s+ \d+ \s+ (-1|\d+) \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \S* \n)+ $/
5958
6059
- do:
6160
cat.thread_pool:
@@ -71,11 +70,11 @@
7170
7271
- do:
7372
cat.thread_pool:
74-
thread_pool_patterns: bulk,search
73+
thread_pool_patterns: write,search
7574
size: ""
7675

7776
- match:
7877
$body: |
7978
/ #node_name name active queue rejected
80-
^ (\S+ \s+ bulk \s+ \d+ \s+ \d+ \s+ \d+ \n
81-
\S+ \s+ search \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/
79+
^ (\S+ \s+ search \s+ \d+ \s+ \d+ \s+ \d+ \n
80+
\S+ \s+ write \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/

server/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public TransportShardBulkAction(Settings settings, TransportService transportSer
8383
MappingUpdatedAction mappingUpdatedAction, UpdateHelper updateHelper, ActionFilters actionFilters,
8484
IndexNameExpressionResolver indexNameExpressionResolver) {
8585
super(settings, ACTION_NAME, transportService, clusterService, indicesService, threadPool, shardStateAction, actionFilters,
86-
indexNameExpressionResolver, BulkShardRequest::new, BulkShardRequest::new, ThreadPool.Names.BULK);
86+
indexNameExpressionResolver, BulkShardRequest::new, BulkShardRequest::new, ThreadPool.Names.WRITE);
8787
this.updateHelper = updateHelper;
8888
this.mappingUpdatedAction = mappingUpdatedAction;
8989
}

server/src/main/java/org/elasticsearch/action/delete/TransportDeleteAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public TransportDeleteAction(Settings settings, TransportService transportServic
4646
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
4747
TransportBulkAction bulkAction, TransportShardBulkAction shardBulkAction) {
4848
super(settings, DeleteAction.NAME, transportService, clusterService, indicesService, threadPool, shardStateAction,
49-
actionFilters, indexNameExpressionResolver, DeleteRequest::new, DeleteRequest::new, ThreadPool.Names.BULK,
49+
actionFilters, indexNameExpressionResolver, DeleteRequest::new, DeleteRequest::new, ThreadPool.Names.WRITE,
5050
bulkAction, shardBulkAction);
5151
}
5252

server/src/main/java/org/elasticsearch/action/index/TransportIndexAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public TransportIndexAction(Settings settings, TransportService transportService
5454
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
5555
TransportBulkAction bulkAction, TransportShardBulkAction shardBulkAction) {
5656
super(settings, IndexAction.NAME, transportService, clusterService, indicesService, threadPool, shardStateAction,
57-
actionFilters, indexNameExpressionResolver, IndexRequest::new, IndexRequest::new, ThreadPool.Names.BULK,
57+
actionFilters, indexNameExpressionResolver, IndexRequest::new, IndexRequest::new, ThreadPool.Names.WRITE,
5858
bulkAction, shardBulkAction);
5959
}
6060

server/src/main/java/org/elasticsearch/action/resync/TransportResyncReplicationAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public TransportResyncReplicationAction(Settings settings, TransportService tran
6060
ShardStateAction shardStateAction, ActionFilters actionFilters,
6161
IndexNameExpressionResolver indexNameExpressionResolver) {
6262
super(settings, ACTION_NAME, transportService, clusterService, indicesService, threadPool, shardStateAction, actionFilters,
63-
indexNameExpressionResolver, ResyncReplicationRequest::new, ResyncReplicationRequest::new, ThreadPool.Names.BULK);
63+
indexNameExpressionResolver, ResyncReplicationRequest::new, ResyncReplicationRequest::new, ThreadPool.Names.WRITE);
6464
}
6565

6666
@Override

server/src/main/java/org/elasticsearch/action/update/TransportUpdateAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public TransportUpdateAction(Settings settings, ThreadPool threadPool, ClusterSe
8686

8787
@Override
8888
protected String executor() {
89-
return ThreadPool.Names.BULK;
89+
return ThreadPool.Names.WRITE;
9090
}
9191

9292
@Override

0 commit comments

Comments
 (0)