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

support set truncate_index manually in on_snapshot_save #457

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JayiceZ
Copy link

@JayiceZ JayiceZ commented Jun 5, 2024

In braft, creating a snapshot will result in the truncation of logs, and users can not decide which logs will be truncated after snapshot_save.
But sometimes, user wants to take over it and decides which logs should be retained.

For example, last_index=20 now, And snapshot_save is issued, but I don’t want to truncate all the logs before 20.
On the contrary, logs between 11-20 should be kept and only logs before 11 will be truncated. But now, users can't achieve it. : (

I believe it will be a useful feature. By fully controlling the truncate index, users can use raft log as WAL of non-volatile StateMachine or to implement CDC etc.

@JayiceZ JayiceZ changed the title support set truncate_index manually in on_snaoshot_save support set truncate_index manually in on_snapshot_save Jun 5, 2024
@JayiceZ JayiceZ closed this Jun 6, 2024
@JayiceZ JayiceZ reopened this Jul 22, 2024
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.

1 participant