Skip to content

Commit 18bcd3d

Browse files
committed
docs: explain why certain implementations were chosen
1 parent 808af43 commit 18bcd3d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

x-pack/plugin/ilm/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ilm/CCRIndexLifecycleIT.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,9 @@ public void testTsdbLeaderIndexRolloverAndSyncAfterWaitUntilEndTime() throws Exc
582582
templateRequest.setJsonEntity(Strings.format(TSDB_INDEX_TEMPLATE, indexPattern, policyName));
583583
assertOK(client().performRequest(templateRequest));
584584
} else if ("follow".equals(targetCluster)) {
585+
// Use unfollow-only policy for follower cluster instead of regular ILM policy
586+
// Follower clusters should not have their own rollover actions as they are meant
587+
// to follow the rollover behavior of the leader index, not initiate their own rollovers
585588
putUnfollowOnlyPolicy(client(), policyName);
586589

587590
Request createAutoFollowRequest = new Request("PUT", "/_ccr/auto_follow/tsdb_index_auto_follow_pattern");
@@ -596,6 +599,10 @@ public void testTsdbLeaderIndexRolloverAndSyncAfterWaitUntilEndTime() throws Exc
596599

597600
try (RestClient leaderClient = buildLeaderClient()) {
598601
String now = DateFormatter.forPattern(FormatNames.STRICT_DATE_OPTIONAL_TIME.getName()).format(Instant.now());
602+
603+
// Wait for ILM rollover instead of manual rollover to ensure 'index.lifecycle.indexing_complete' is set
604+
// Manual rollover removed as it doesn't properly set lifecycle completion flag
605+
// Let ILM naturally trigger rollover when document is indexed
599606
index(leaderClient, dataStream, "", "@timestamp", now, "volume", 11.0, "metricset", randomAlphaOfLength(5));
600607

601608
String backingIndexName = getDataStreamBackingIndexNames(leaderClient, "tsdb-index-cpu").get(0);

0 commit comments

Comments
 (0)