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

Discontinuous append queue file sequnce #350

Open
v0y4g3r opened this issue Jan 10, 2024 · 3 comments
Open

Discontinuous append queue file sequnce #350

v0y4g3r opened this issue Jan 10, 2024 · 3 comments

Comments

@v0y4g3r
Copy link

v0y4g3r commented Jan 10, 2024

Accidentally I found that raft-engine's data directory contains discontinuous file sequences in append queue:

0000000000000003.rewrite
0000000000000846.raftlog
0000000000000847.raftlog
0000000000000848.raftlog
0000000000000849.raftlog
0000000000000850.raftlog
0000000000000851.raftlog
0000000000000852.raftlog
0000000000000853.raftlog
0000000000000854.raftlog
0000000000000855.raftlog
0000000000000856.raftlog
0000000000000857.raftlog
0000000000000858.raftlog
0000000000000859.raftlog
0000000000000860.raftlog < here
0000000000000890.raftlog

During raft-engine's recover process, all files before 0000000000000890 in append queue will be skipped.
I am curious if such a situation would occur in normal program operation as when I dive into the purge code:

let mut tail = files.split_off(off);

Looks like in purge_to method normally all files before file_seq are either all deleted or not.

@tabokie
Copy link
Member

tabokie commented Jan 11, 2024

I think it's caused by file recycling (SinglePipe::recycled_files), some of obsolete log files will be kept around for future writes to reuse. After #310, those files no longer use a different file extension, so you can't distinguish them based on file name alone.

@v0y4g3r
Copy link
Author

v0y4g3r commented Jan 11, 2024

I think it's caused by file recycling (SinglePipe::recycled_files), some of obsolete log files will be kept around for future writes to reuse. After #310, those files no longer use a different file extension, so you can't distinguish them based on file name alone.

Log recycle is not enabled yet, could it be any other reason?

@tabokie
Copy link
Member

tabokie commented Jan 11, 2024

Did you disable it explicitly? It is enabled by default for a while now.

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

No branches or pull requests

2 participants