-
Notifications
You must be signed in to change notification settings - Fork 473
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
FastHeadersSyncFeed explicitly flush before setting metadata #8103
base: master
Are you sure you want to change the base?
Conversation
9a0ef1f
to
c7f2a1d
Compare
c7f2a1d
to
5df524c
Compare
Do you have some performance figure? Also, where is the NoWAL flag in fast header? If that is not use, there is not much use for an explicit flush. The thing about blocks and receipts is that, once the compaction writes was reduced enough, the portion of the writes for the WAL file was large enough that it is worth optimizing away. The thing about headers is that, it is not parallelized when inserting because of the total difficulty calculation, so it straight up can't saturate the IO bandwidth. Latency, sure, but not bandwith. Having a way insert batch of headers instead of one by one would help it a lot. |
I'll clear it out.
I see.
This was not intended to be addressed here, but surely I'll take a look. |
@asdacap I've reviewed the answers and I think I need more imperative input or a review that points to the missing ones. Specifically:
|
Discussed offline, so basically, there is no need for flush unless NoWAL flag is used, in which case, you MUST flush. Especially in the case that kamil gave as the system does not crash, only the app. |
Closes #8029
This PR makes the flush of the underlying databases explicit for
HeadersSyncFeed
inserting headers. It's a change similar to a fix done in #6227 which explicitly calls the flush after a specific boundary is breached. This PR flushes the headers after each batch. If a performance penalty occurs, it should be done in an amortized way, every N batches set.In addition
BodiesSyncFeed
is modified, so that it Flushes the underlying database in the same wayHeadersSyncFeed
does it. It calls the.Flush
with a specific reason.Changes
.Flush
of the underlying databaseTypes of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Optional. Remove if not applicable.
Documentation
Requires documentation update
If yes, link the PR to the docs update or the issue with the details labeled
docs
. Remove if not applicable.Requires explanation in Release Notes
If yes, fill in the details here. Remove if not applicable.
Remarks
Optional. Remove if not applicable.