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

[chainstore] chainstore 优化 / chainstore optimization #5958

Closed
4 tasks
Fatman13 opened this issue May 12, 2023 · 0 comments
Closed
4 tasks

[chainstore] chainstore 优化 / chainstore optimization #5958

Fatman13 opened this issue May 12, 2023 · 0 comments
Labels
C-enhancement Category: feature enhancement

Comments

@Fatman13
Copy link
Contributor

Fatman13 commented May 12, 2023

关联:

I've noticed multiple test failures* resulting from the observer system getting confused because it's asked to "apply" the same tipset as its current head. I'm not entirely sure why this happens, and I'm pretty sure there's an underlying issue (because the tipset question later can't be found in the blockstore for some reason).

BUT, regardless, we can just shortcut if we're ever asked to MaybeTakeHeavierTipset, which looks possible given that sync workers as well as SyncSubmitBlock can lead here.

*example 1, example 2, example 3

This makes two changes:

Write headers in chain order, not reverse order. This shouldn't matter, but it may help if badger crashes.
Force collectChain to collect the correct chain. This shouldn't matter, but we might as well (as long as it's safe).
WRT 1, I'm worried about the following:

Attempt to sync a chain from epochs 3-7.
Write tipsets 7, 6, 5.
Badger realizes that the current vlog is "full", so it creates a new one.
Write tipsets 4, 3.
My concern is that, while badger will write synchronously, it doesn't call fsync on the file itself, and the directory containing the file. That means, if the machine crashes, the new vlog might just disappear.

Of course, the right solution would be to fix badger to sync the file/directory metadata, but that's not likely to happen, ever.

@Fatman13 Fatman13 added C-enhancement Category: feature enhancement C-triage Category: Need triage labels May 12, 2023
@simlecode simlecode removed the C-triage Category: Need triage label May 12, 2023
@simlecode simlecode removed their assignment May 12, 2023
@simlecode simlecode closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: feature enhancement
Projects
Status: Done
Development

No branches or pull requests

2 participants