Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fcofdez committed May 26, 2021
1 parent ecffb4f commit c531a60
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected GetAutoFollowPatternAction.Response createServerTestInstance(XContentT
for (int i = 0; i < numPatterns; i++) {
String remoteCluster = randomAlphaOfLength(4);
List<String> leaderIndexPatterns = Collections.singletonList(randomAlphaOfLength(4));
List<String> leaderIndexExclusionsPatterns = Collections.singletonList(randomAlphaOfLength(4));
List<String> leaderIndexExclusionsPatterns = randomList(0, randomIntBetween(1, 10), () -> randomAlphaOfLength(4));
String followIndexNamePattern = randomAlphaOfLength(4);
final Settings settings =
Settings.builder().put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), randomIntBetween(0, 4)).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@
body:
remote_cluster: local
leader_index_patterns: ['logs-*']
leader_index_exclusion_patterns: ['logs-excluded']
max_outstanding_read_requests: 2
- is_true: acknowledged

Expand Down Expand Up @@ -233,7 +232,6 @@
- match: { patterns.0.name: 'pattern_test' }
- match: { patterns.0.pattern.remote_cluster: 'local' }
- match: { patterns.0.pattern.leader_index_patterns: ['logs-*'] }
- match: { patterns.0.pattern.leader_index_exclusion_patterns: ['logs-excluded'] }
- match: { patterns.0.pattern.max_outstanding_read_requests: 2 }
- match: { patterns.0.pattern.active: false }

Expand All @@ -253,7 +251,6 @@
- match: { patterns.0.name: 'pattern_test' }
- match: { patterns.0.pattern.remote_cluster: 'local' }
- match: { patterns.0.pattern.leader_index_patterns: ['logs-*'] }
- match: { patterns.0.pattern.leader_index_exclusion_patterns: ['logs-excluded'] }
- match: { patterns.0.pattern.max_outstanding_read_requests: 2 }
- match: { patterns.0.pattern.active: true }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,23 +522,21 @@ public void testAutoFollowExclusion() throws Exception {

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

createLeaderIndex("logs-201801", leaderIndexSettings);
AutoFollowStats autoFollowStats = getAutoFollowStats();
assertThat(autoFollowStats.getNumberOfSuccessfulFollowIndices(), equalTo(0L));
assertThat(autoFollowStats.getNumberOfFailedFollowIndices(), equalTo(0L));
assertThat(autoFollowStats.getNumberOfFailedRemoteClusterStateRequests(), equalTo(0L));
assertFalse(ESIntegTestCase.indexExists("copy-logs-201801", followerClient()));

createLeaderIndex("logs-201701", leaderIndexSettings);
assertLongBusy(() -> {
AutoFollowStats autoFollowStats = getAutoFollowStats();
assertThat(autoFollowStats.getNumberOfSuccessfulFollowIndices(), equalTo(1L));
assertThat(autoFollowStats.getNumberOfFailedFollowIndices(), equalTo(0L));
assertThat(autoFollowStats.getNumberOfFailedRemoteClusterStateRequests(), equalTo(0L));
AutoFollowStats autoFollowStatsResponse = getAutoFollowStats();
assertThat(autoFollowStatsResponse.getNumberOfSuccessfulFollowIndices(), equalTo(1L));
assertThat(autoFollowStatsResponse.getNumberOfFailedFollowIndices(), greaterThanOrEqualTo(0L));
assertThat(autoFollowStatsResponse.getNumberOfFailedRemoteClusterStateRequests(), equalTo(0L));
});
assertTrue(ESIntegTestCase.indexExists("copy-logs-201701", followerClient()));

createLeaderIndex("logs-201801", leaderIndexSettings);
assertLongBusy(() -> {
AutoFollowStats autoFollowStats = getAutoFollowStats();
assertThat(autoFollowStats.getNumberOfSuccessfulFollowIndices(), equalTo(1L));
assertThat(autoFollowStats.getNumberOfFailedFollowIndices(), greaterThanOrEqualTo(0L));
assertThat(autoFollowStats.getNumberOfFailedRemoteClusterStateRequests(), equalTo(0L));
});

assertFalse(ESIntegTestCase.indexExists("copy-logs-201801", followerClient()));
}

Expand Down

0 comments on commit c531a60

Please sign in to comment.