Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't overwrite DataStream.rolloverOnWrite flag on failure store rollover #107247

Merged
merged 3 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ public DataStream unsafeRolloverFailureStore(Index writeIndex, long generation)
lifecycle,
failureStore,
failureIndices,
false,
rolloverOnWrite,
autoShardingEvent
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ public void testRollover() {
assertThat(rolledDs.getIndices().size(), equalTo(ds.getIndices().size() + 1));
assertTrue(rolledDs.getIndices().containsAll(ds.getIndices()));
assertTrue(rolledDs.getIndices().contains(rolledDs.getWriteIndex()));
// Irrespective of whether the rollover was performed lazily, rolloverOnWrite should always be set to false after rollover.
assertFalse(rolledDs.rolloverOnWrite());
}

public void testRolloverWithConflictingBackingIndexName() {
Expand Down Expand Up @@ -272,6 +274,8 @@ public void testRolloverFailureStore() {
assertThat(rolledDs.getName(), equalTo(ds.getName()));
assertThat(rolledDs.getGeneration(), equalTo(ds.getGeneration() + 1));
assertThat(rolledDs.getIndices().size(), equalTo(ds.getIndices().size()));
// Ensure that the rolloverOnWrite flag hasn't changed when rolling over a failure store.
assertThat(rolledDs.rolloverOnWrite(), equalTo(ds.rolloverOnWrite()));
assertThat(rolledDs.getFailureIndices().size(), equalTo(ds.getFailureIndices().size() + 1));
assertTrue(rolledDs.getIndices().containsAll(ds.getIndices()));
assertTrue(rolledDs.getIndices().contains(rolledDs.getWriteIndex()));
Expand Down