Skip to content

support set truncate_index manually in on_snapshot_save#457

Open
JayiceZ wants to merge 2 commits into
baidu:masterfrom
JayiceZ:snapshot_index
Open

support set truncate_index manually in on_snapshot_save#457
JayiceZ wants to merge 2 commits into
baidu:masterfrom
JayiceZ:snapshot_index

Conversation

@JayiceZ

@JayiceZ JayiceZ commented Jun 5, 2024

Copy link
Copy Markdown

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