Skip to content

Commit e339270

Browse files
dnhatnmartijnvg
authored andcommitted
CCR: Rename follow-task parameters and stats (#34836)
* CCR: Rename follow parameters and stats This commit renames the follow-task parameters and its stats. Below are the changes: ## Params - remote_cluster (unchanged) - leader_index (unchanged) - max_read_request_operation_count -> max_read_request_operation_count - max_batch_size -> max_read_request_size - max_write_request_operation_count (new) - max_write_request_size (new) - max_concurrent_read_batches -> max_outstanding_read_requests - max_concurrent_write_batches -> max_outstanding_write_requests - max_write_buffer_size (unchanged) - max_write_buffer_count (unchanged) - max_retry_delay (unchanged) - poll_timeout -> read_poll_timeout ## Stats - remote_cluster (unchanged) - leader_index (unchanged) - follower_index (unchanged) - shard_id (unchanged) - leader_global_checkpoint (unchanged) - leader_max_seq_no (unchanged) - follower_global_checkpoint (unchanged) - follower_max_seq_no (unchanged) - last_requested_seq_no (unchanged) - number_of_concurrent_reads -> outstanding_read_requests - number_of_concurrent_writes -> outstanding_write_requests - buffer_size_in_bytes -> write_buffer_size_in_bytes (new) - number_of_queued_writes -> write_buffer_operation_count - mapping_version -> follower_mapping_version - total_fetch_time_millis -> total_read_time_millis - total_fetch_remote_time_millis -> total_read_remote_exec_time_millis - number_of_successful_fetches -> successful_read_requests - number_of_failed_fetches -> failed_read_requests - operation_received -> operations_read - total_transferred_bytes -> bytes_read - total_index_time_millis -> total_write_time_millis [?] - number_of_successful_bulk_operations -> successful_write_requests - number_of_failed_bulk_operations -> failed_write_requests - number_of_operations_indexed -> operations_written - fetch_exception -> read_exceptions - time_since_last_read_millis -> time_since_last_read_millis * add test for max_write_request_(operation_count|size)
1 parent f6c27a7 commit e339270

36 files changed

+1215
-918
lines changed

x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/test/ccr/auto_follow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@
2525
body:
2626
remote_cluster: local
2727
leader_index_patterns: ['logs-*']
28-
max_concurrent_read_batches: 2
28+
max_outstanding_read_requests: 2
2929
- is_true: acknowledged
3030

3131
- do:
3232
ccr.get_auto_follow_pattern:
3333
name: my_pattern
3434
- match: { my_pattern.remote_cluster: 'local' }
3535
- match: { my_pattern.leader_index_patterns: ['logs-*'] }
36-
- match: { my_pattern.max_concurrent_read_batches: 2 }
36+
- match: { my_pattern.max_outstanding_read_requests: 2 }
3737

3838
- do:
3939
ccr.get_auto_follow_pattern: {}
4040
- match: { my_pattern.remote_cluster: 'local' }
4141
- match: { my_pattern.leader_index_patterns: ['logs-*'] }
42-
- match: { my_pattern.max_concurrent_read_batches: 2 }
42+
- match: { my_pattern.max_outstanding_read_requests: 2 }
4343

4444
- do:
4545
ccr.delete_auto_follow_pattern:

x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/test/ccr/follow_stats.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,21 @@
5757
- gte: { indices.0.shards.0.follower_global_checkpoint: -1 }
5858
- gte: { indices.0.shards.0.follower_max_seq_no: -1 }
5959
- gte: { indices.0.shards.0.last_requested_seq_no: -1 }
60-
- gte: { indices.0.shards.0.number_of_concurrent_reads: 0 }
61-
- match: { indices.0.shards.0.number_of_concurrent_writes: 0 }
62-
- match: { indices.0.shards.0.number_of_queued_writes: 0 }
63-
- gte: { indices.0.shards.0.mapping_version: 0 }
64-
- gte: { indices.0.shards.0.total_fetch_time_millis: 0 }
65-
- gte: { indices.0.shards.0.number_of_successful_fetches: 0 }
66-
- gte: { indices.0.shards.0.number_of_failed_fetches: 0 }
67-
- match: { indices.0.shards.0.operations_received: 0 }
68-
- match: { indices.0.shards.0.total_transferred_bytes: 0 }
69-
- match: { indices.0.shards.0.total_index_time_millis: 0 }
70-
- match: { indices.0.shards.0.number_of_successful_bulk_operations: 0 }
71-
- match: { indices.0.shards.0.number_of_failed_bulk_operations: 0 }
72-
- match: { indices.0.shards.0.number_of_operations_indexed: 0 }
73-
- length: { indices.0.shards.0.fetch_exceptions: 0 }
74-
- gte: { indices.0.shards.0.time_since_last_fetch_millis: -1 }
60+
- gte: { indices.0.shards.0.outstanding_read_requests: 0 }
61+
- match: { indices.0.shards.0.outstanding_write_requests: 0 }
62+
- match: { indices.0.shards.0.write_buffer_operation_count: 0 }
63+
- gte: { indices.0.shards.0.follower_mapping_version: 0 }
64+
- gte: { indices.0.shards.0.total_read_time_millis: 0 }
65+
- gte: { indices.0.shards.0.successful_read_requests: 0 }
66+
- gte: { indices.0.shards.0.failed_read_requests: 0 }
67+
- match: { indices.0.shards.0.operations_read: 0 }
68+
- match: { indices.0.shards.0.bytes_read: 0 }
69+
- match: { indices.0.shards.0.total_write_time_millis: 0 }
70+
- match: { indices.0.shards.0.successful_write_requests: 0 }
71+
- match: { indices.0.shards.0.failed_write_requests: 0 }
72+
- match: { indices.0.shards.0.operations_written: 0 }
73+
- length: { indices.0.shards.0.read_exceptions: 0 }
74+
- gte: { indices.0.shards.0.time_since_last_read_millis: -1 }
7575

7676
- do:
7777
ccr.pause_follow:

x-pack/plugin/ccr/qa/src/main/java/org/elasticsearch/xpack/ccr/ESCCRRestTestCase.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected static void refresh(String index) throws IOException {
5959

6060
protected static void resumeFollow(String followIndex) throws IOException {
6161
final Request request = new Request("POST", "/" + followIndex + "/_ccr/resume_follow");
62-
request.setJsonEntity("{\"poll_timeout\": \"10ms\"}");
62+
request.setJsonEntity("{\"read_poll_timeout\": \"10ms\"}");
6363
assertOK(client().performRequest(request));
6464
}
6565

@@ -74,7 +74,7 @@ protected static void followIndex(String leaderCluster, String leaderIndex, Stri
7474
protected static void followIndex(RestClient client, String leaderCluster, String leaderIndex, String followIndex) throws IOException {
7575
final Request request = new Request("PUT", "/" + followIndex + "/_ccr/follow");
7676
request.setJsonEntity("{\"remote_cluster\": \"" + leaderCluster + "\", \"leader_index\": \"" + leaderIndex +
77-
"\", \"poll_timeout\": \"10ms\"}");
77+
"\", \"read_poll_timeout\": \"10ms\"}");
7878
assertOK(client.performRequest(request));
7979
}
8080

@@ -136,10 +136,10 @@ protected static void verifyCcrMonitoring(final String expectedLeaderIndex, fina
136136
assertThat(followerIndex, equalTo(expectedFollowerIndex));
137137

138138
int foundNumberOfOperationsReceived =
139-
(int) XContentMapValues.extractValue("_source.ccr_stats.operations_received", hit);
139+
(int) XContentMapValues.extractValue("_source.ccr_stats.operations_read", hit);
140140
numberOfOperationsReceived = Math.max(numberOfOperationsReceived, foundNumberOfOperationsReceived);
141141
int foundNumberOfOperationsIndexed =
142-
(int) XContentMapValues.extractValue("_source.ccr_stats.number_of_operations_indexed", hit);
142+
(int) XContentMapValues.extractValue("_source.ccr_stats.operations_written", hit);
143143
numberOfOperationsIndexed = Math.max(numberOfOperationsIndexed, foundNumberOfOperationsIndexed);
144144
}
145145

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/AutoFollowCoordinator.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,16 @@ private void followLeaderIndex(String autoFollowPattenName,
324324

325325
ResumeFollowAction.Request followRequest = new ResumeFollowAction.Request();
326326
followRequest.setFollowerIndex(followIndexName);
327-
followRequest.setMaxBatchOperationCount(pattern.getMaxBatchOperationCount());
328-
followRequest.setMaxConcurrentReadBatches(pattern.getMaxConcurrentReadBatches());
329-
followRequest.setMaxBatchSize(pattern.getMaxBatchSize());
330-
followRequest.setMaxConcurrentWriteBatches(pattern.getMaxConcurrentWriteBatches());
327+
followRequest.setMaxReadRequestOperationCount(pattern.getMaxReadRequestOperationCount());
328+
followRequest.setMaxReadRequestSize(pattern.getMaxReadRequestSize());
329+
followRequest.setMaxOutstandingReadRequests(pattern.getMaxOutstandingReadRequests());
330+
followRequest.setMaxWriteRequestOperationCount(pattern.getMaxWriteRequestOperationCount());
331+
followRequest.setMaxWriteRequestSize(pattern.getMaxWriteRequestSize());
332+
followRequest.setMaxOutstandingWriteRequests(pattern.getMaxOutstandingWriteRequests());
331333
followRequest.setMaxWriteBufferCount(pattern.getMaxWriteBufferCount());
332334
followRequest.setMaxWriteBufferSize(pattern.getMaxWriteBufferSize());
333335
followRequest.setMaxRetryDelay(pattern.getMaxRetryDelay());
334-
followRequest.setPollTimeout(pattern.getPollTimeout());
336+
followRequest.setReadPollTimeout(pattern.getPollTimeout());
335337

336338
PutFollowAction.Request request = new PutFollowAction.Request();
337339
request.setRemoteCluster(remoteCluster);

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/ShardChangesAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ public static class Request extends SingleShardRequest<Request> {
7272
private int maxOperationCount;
7373
private ShardId shardId;
7474
private String expectedHistoryUUID;
75-
private TimeValue pollTimeout = TransportResumeFollowAction.DEFAULT_POLL_TIMEOUT;
76-
private ByteSizeValue maxBatchSize = TransportResumeFollowAction.DEFAULT_MAX_BATCH_SIZE;
75+
private TimeValue pollTimeout = TransportResumeFollowAction.DEFAULT_READ_POLL_TIMEOUT;
76+
private ByteSizeValue maxBatchSize = TransportResumeFollowAction.DEFAULT_MAX_READ_REQUEST_SIZE;
7777

7878
private long relativeStartNanos;
7979

0 commit comments

Comments
 (0)