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

feat: [MR-609] More eagerly remove replicated state at checkpoint heights #906

Merged
merged 23 commits into from
Dec 13, 2024

Conversation

ShuoWangNSL
Copy link
Contributor

@ShuoWangNSL ShuoWangNSL commented Aug 13, 2024

Close MR-609

After several preparation PRs manage to keep extra in-memory states required for pending CUP, remove_inmemory_states_below can now safely remove in-memory states at previous checkpoint heights.

In order to do that, we separate checkpoints_to_keep and inmemory_states_keep in remove_states_below_impl. As a result, snapshots and states_metadata are not in sync anymore. We need to adjust some logic when updating them in state sync and commit_and_certify.

@ShuoWangNSL ShuoWangNSL force-pushed the shuo/remove_replicated_state_prev_checkpoint branch from 5744373 to c52b2c0 Compare August 15, 2024 07:01
@ShuoWangNSL ShuoWangNSL force-pushed the shuo/remove_replicated_state_prev_checkpoint branch from c52b2c0 to 7cefc91 Compare September 3, 2024 14:40
@ShuoWangNSL ShuoWangNSL force-pushed the shuo/remove_replicated_state_prev_checkpoint branch 2 times, most recently from 004ba13 to 54e5937 Compare September 24, 2024 14:40
@ShuoWangNSL ShuoWangNSL force-pushed the shuo/remove_replicated_state_prev_checkpoint branch from 54e5937 to ec44391 Compare September 25, 2024 14:08
@ShuoWangNSL ShuoWangNSL force-pushed the shuo/remove_replicated_state_prev_checkpoint branch from ec44391 to 06e6393 Compare October 1, 2024 02:38
@ShuoWangNSL ShuoWangNSL force-pushed the shuo/remove_replicated_state_prev_checkpoint branch from c36213e to 9bcad6f Compare October 29, 2024 07:25
github-merge-queue bot pushed a commit that referenced this pull request Nov 6, 2024
…llback (#2454)

In #2223, Consensus starts call
`remove_inmemory_states_below` with extra heights to keep.

This PR logs how Consensus calls this API when it has some extra states
to keep. It also logs potential removal candidates of in-memory states
at checkpoint heights in #906.

The logs will be monitored for a while before any actual more eager
removal by #906 happens in production.

With the proper protection, getting in-memory states should not fall
back to loading checkpoints in normal operation. Therefore, this PR also
increases the `state_manager_error_count` if that happens.
@ShuoWangNSL ShuoWangNSL force-pushed the shuo/remove_replicated_state_prev_checkpoint branch from 9bcad6f to c7e4d91 Compare November 6, 2024 22:42
@ShuoWangNSL ShuoWangNSL changed the title More eagerly remove replicated state at checkpointed heights feat: [MR-609] More eagerly remove replicated state at checkpoint heights Nov 6, 2024
@github-actions github-actions bot added the feat label Nov 6, 2024
@ShuoWangNSL ShuoWangNSL force-pushed the shuo/remove_replicated_state_prev_checkpoint branch from c7e4d91 to 6b20ea4 Compare November 19, 2024 07:11
@ShuoWangNSL ShuoWangNSL marked this pull request as ready for review November 20, 2024 14:59
@ShuoWangNSL ShuoWangNSL requested a review from a team as a code owner November 20, 2024 14:59
@ShuoWangNSL ShuoWangNSL added this pull request to the merge queue Dec 13, 2024
Merged via the queue into master with commit 52e0fac Dec 13, 2024
26 checks passed
@ShuoWangNSL ShuoWangNSL deleted the shuo/remove_replicated_state_prev_checkpoint branch December 13, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants