-
Notifications
You must be signed in to change notification settings - Fork 459
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
Feature/disable wal flag #5702
Feature/disable wal flag #5702
Conversation
@@ -182,6 +182,8 @@ protected virtual void RunPruning(IPruningContext pruning, Keccak statRoot) | |||
writeFlags = WriteFlags.None; | |||
} | |||
|
|||
writeFlags |= WriteFlags.DisableWAL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not start with it and then set LowPriority
based on _pruningConfig.FullPruningDisableLowPriorityWrites
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would do too.
private WriteOptions? _noWalWrite; | ||
private WriteOptions? _lowPriorityAndNoWalWrite; | ||
private WriteOptions? _lowPriorityWriteOptions; | ||
private ReadOptions? _readAheadReadOptions = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can/should they be static?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, WriteAheadLogSync
is from config.
@@ -499,9 +514,19 @@ public void Set(ReadOnlySpan<byte> key, byte[]? value, WriteFlags flags = WriteF | |||
|
|||
public WriteOptions? WriteFlagsToWriteOptions(WriteFlags flags) | |||
{ | |||
if (flags == WriteFlags.LowPriority) | |||
if ((flags & WriteFlags.LowPriority) != 0 && (flags & WriteFlags.DisableWAL) != 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either save flags to bool
and reuse them or check for both flags in one go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
DisableWAL
a better more universal term for flag would beNoDurable
,NonDurable
,DurabilityNotRequired
or something, but can't find a good one. Got idea?Changes
DisableWAL
write flag. Integrate with RocksDB, SnapSync and FullPruning.Types 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.
Remarks
Optional. Remove if not applicable.