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

Call truncate on leaders AND followers #3908

Merged
merged 1 commit into from
Oct 8, 2023

Conversation

guilload
Copy link
Member

@guilload guilload commented Oct 3, 2023

Description

Before this change, indexers called truncate on leaders, and leaders replicated the truncation request on followers. After this change, indexers are responsible for calling truncate on both leaders and followers. Leaders are no longer in charge of replicating the request.

That way, followers see their queues truncated even if leaders are unavailable. The code is also simplified.

How was this PR tested?

Updated tests

@guilload guilload force-pushed the guilload/close-shards-delete-queues-on-startup branch from ff571c9 to 1f9ddbb Compare October 4, 2023 16:51
@guilload guilload force-pushed the guilload/call-truncate-on-leader-and-follower branch from 026c87c to df0807b Compare October 4, 2023 17:42
@guilload guilload force-pushed the guilload/call-truncate-on-leader-and-follower branch from df0807b to 72686e4 Compare October 4, 2023 17:51
@guilload guilload force-pushed the guilload/close-shards-delete-queues-on-startup branch from 1f9ddbb to 1de1432 Compare October 5, 2023 16:37
@guilload guilload force-pushed the guilload/call-truncate-on-leader-and-follower branch from 72686e4 to 5eafb0e Compare October 5, 2023 16:48
@guilload guilload force-pushed the guilload/close-shards-delete-queues-on-startup branch from 1de1432 to 64ea389 Compare October 6, 2023 13:57
@guilload guilload force-pushed the guilload/call-truncate-on-leader-and-follower branch from 5eafb0e to 1220169 Compare October 6, 2023 14:23
@guilload guilload linked an issue Oct 6, 2023 that may be closed by this pull request
@guilload guilload force-pushed the guilload/close-shards-delete-queues-on-startup branch 2 times, most recently from 0c7c884 to aa0fc9f Compare October 6, 2023 19:20
Base automatically changed from guilload/close-shards-delete-queues-on-startup to main October 6, 2023 19:49
@guilload guilload force-pushed the guilload/call-truncate-on-leader-and-follower branch from 1220169 to 26cdbce Compare October 6, 2023 20:03
@guilload guilload force-pushed the guilload/call-truncate-on-leader-and-follower branch from 26cdbce to 42eadaa Compare October 6, 2023 20:30
@@ -202,7 +202,8 @@ mod tests {
mrecordlog.clone(),
state.clone(),
);
tokio::time::sleep(REMOVAL_GRACE_PERIOD * 2).await;
// Wait for the removal task to run.
tokio::time::sleep(Duration::from_millis(100)).await;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this test will be flaky.

@guilload guilload merged commit 9676b12 into main Oct 8, 2023
4 checks passed
@guilload guilload deleted the guilload/call-truncate-on-leader-and-follower branch October 8, 2023 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Indexers should call Truncate on the leader AND follower of shard
2 participants