Skip to content

Commit c531a60

Browse files
committed
Review comments
1 parent ecffb4f commit c531a60

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/GetAutoFollowPatternResponseTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected GetAutoFollowPatternAction.Response createServerTestInstance(XContentT
3939
for (int i = 0; i < numPatterns; i++) {
4040
String remoteCluster = randomAlphaOfLength(4);
4141
List<String> leaderIndexPatterns = Collections.singletonList(randomAlphaOfLength(4));
42-
List<String> leaderIndexExclusionsPatterns = Collections.singletonList(randomAlphaOfLength(4));
42+
List<String> leaderIndexExclusionsPatterns = randomList(0, randomIntBetween(1, 10), () -> randomAlphaOfLength(4));
4343
String followIndexNamePattern = randomAlphaOfLength(4);
4444
final Settings settings =
4545
Settings.builder().put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), randomIntBetween(0, 4)).build();

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@
204204
body:
205205
remote_cluster: local
206206
leader_index_patterns: ['logs-*']
207-
leader_index_exclusion_patterns: ['logs-excluded']
208207
max_outstanding_read_requests: 2
209208
- is_true: acknowledged
210209

@@ -233,7 +232,6 @@
233232
- match: { patterns.0.name: 'pattern_test' }
234233
- match: { patterns.0.pattern.remote_cluster: 'local' }
235234
- match: { patterns.0.pattern.leader_index_patterns: ['logs-*'] }
236-
- match: { patterns.0.pattern.leader_index_exclusion_patterns: ['logs-excluded'] }
237235
- match: { patterns.0.pattern.max_outstanding_read_requests: 2 }
238236
- match: { patterns.0.pattern.active: false }
239237

@@ -253,7 +251,6 @@
253251
- match: { patterns.0.name: 'pattern_test' }
254252
- match: { patterns.0.pattern.remote_cluster: 'local' }
255253
- match: { patterns.0.pattern.leader_index_patterns: ['logs-*'] }
256-
- match: { patterns.0.pattern.leader_index_exclusion_patterns: ['logs-excluded'] }
257254
- match: { patterns.0.pattern.max_outstanding_read_requests: 2 }
258255
- match: { patterns.0.pattern.active: true }
259256

x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/AutoFollowIT.java

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -522,23 +522,21 @@ public void testAutoFollowExclusion() throws Exception {
522522

523523
putAutoFollowPatterns("my-pattern1", new String[] {"logs-*"}, Collections.singletonList("logs-2018*"));
524524

525+
createLeaderIndex("logs-201801", leaderIndexSettings);
526+
AutoFollowStats autoFollowStats = getAutoFollowStats();
527+
assertThat(autoFollowStats.getNumberOfSuccessfulFollowIndices(), equalTo(0L));
528+
assertThat(autoFollowStats.getNumberOfFailedFollowIndices(), equalTo(0L));
529+
assertThat(autoFollowStats.getNumberOfFailedRemoteClusterStateRequests(), equalTo(0L));
530+
assertFalse(ESIntegTestCase.indexExists("copy-logs-201801", followerClient()));
531+
525532
createLeaderIndex("logs-201701", leaderIndexSettings);
526533
assertLongBusy(() -> {
527-
AutoFollowStats autoFollowStats = getAutoFollowStats();
528-
assertThat(autoFollowStats.getNumberOfSuccessfulFollowIndices(), equalTo(1L));
529-
assertThat(autoFollowStats.getNumberOfFailedFollowIndices(), equalTo(0L));
530-
assertThat(autoFollowStats.getNumberOfFailedRemoteClusterStateRequests(), equalTo(0L));
534+
AutoFollowStats autoFollowStatsResponse = getAutoFollowStats();
535+
assertThat(autoFollowStatsResponse.getNumberOfSuccessfulFollowIndices(), equalTo(1L));
536+
assertThat(autoFollowStatsResponse.getNumberOfFailedFollowIndices(), greaterThanOrEqualTo(0L));
537+
assertThat(autoFollowStatsResponse.getNumberOfFailedRemoteClusterStateRequests(), equalTo(0L));
531538
});
532539
assertTrue(ESIntegTestCase.indexExists("copy-logs-201701", followerClient()));
533-
534-
createLeaderIndex("logs-201801", leaderIndexSettings);
535-
assertLongBusy(() -> {
536-
AutoFollowStats autoFollowStats = getAutoFollowStats();
537-
assertThat(autoFollowStats.getNumberOfSuccessfulFollowIndices(), equalTo(1L));
538-
assertThat(autoFollowStats.getNumberOfFailedFollowIndices(), greaterThanOrEqualTo(0L));
539-
assertThat(autoFollowStats.getNumberOfFailedRemoteClusterStateRequests(), equalTo(0L));
540-
});
541-
542540
assertFalse(ESIntegTestCase.indexExists("copy-logs-201801", followerClient()));
543541
}
544542

0 commit comments

Comments
 (0)