-
Notifications
You must be signed in to change notification settings - Fork 968
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
leveldb: throttle manifest rebuilding #414
base: master
Are you sure you want to change the base?
Conversation
Hey @qianbin I was checking your fix #409 and I am wondering why it can make difference. In your fix, it avoids recording some "Added" sstables twice. But in recovery procedure, these duplicated "Added" sstables will not affect the correctness. // New tables.
for _, r := range r.addedTables {
scratch := p.getScratch(r.level)
if scratch.added == nil {
scratch.added = make(map[int64]atRecord)
}
scratch.added[r.num] = r
if scratch.deleted != nil {
delete(scratch.deleted, r.num)
}
} Could you elaborate how does it fix the issue? And also theoretically we can delete the stale MANIFESTs in runtime to save storage right? |
@rjl493456442 you're right. The manifest file is correctly written without duplicated records. The problem is about table reference count. Here goleveldb/leveldb/session_util.go Line 420 in 126854a
rec object, it will be filled with all tables of v , and later when calling setVersion , wrong vDelta is sent, which causes wrong table reference count.
I think it's a good idea. |
@qianbin Ah, right. Thanks for the explanation. |
Co-authored-by: Stephen Buttolph <[email protected]>
the last commit checks the limit on db open. @StephenButtolph it's reverted to use for loop to double the limit. |
I think there's probably still some edge cases here when the compressed manifest size is close to (but not over) Specifically if:
The way I'd have thought to handle this is just doubling |
@StephenButtolph Yes, the edge case can happen.
This is a solution. |
It fixes the problem like #413 .