-
Notifications
You must be signed in to change notification settings - Fork 21k
core, ethdb: introduce database sync function #31703
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
Conversation
Oi |
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.
LGTM
@@ -144,7 +144,7 @@ func (l panicLogger) Fatalf(format string, args ...interface{}) { | |||
|
|||
// New returns a wrapped pebble DB object. The namespace is the prefix that the | |||
// metrics reporting should use for surfacing internal stats. | |||
func New(file string, cache int, handles int, namespace string, readonly bool, ephemeral bool) (*Database, error) { | |||
func New(file string, cache int, handles int, namespace string, readonly bool) (*Database, error) { |
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.
Should we introduce a pebble.Config struct here?
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.
Not sure. It's a bit complicated for external users to configure the Pebble by themselves?
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.
Anyway, it can be done in the following PR!
This pull request introduces a SyncKeyValue function to the ethdb.KeyValueStore interface, providing the ability to forcibly flush all previous writes to disk. This functionality is critical for go-ethereum, which internally uses two independent database engines: a key-value store (such as Pebble, LevelDB, or memoryDB for testing) and a flat-file–based freezer. To ensure write-order consistency between these engines, the key-value store must be explicitly synced before writing to the freezer and vice versa. Fixes - ethereum#31405 - ethereum#29819
This pull request introduces a SyncKeyValue function to the ethdb.KeyValueStore interface, providing the ability to forcibly flush all previous writes to disk. This functionality is critical for go-ethereum, which internally uses two independent database engines: a key-value store (such as Pebble, LevelDB, or memoryDB for testing) and a flat-file–based freezer. To ensure write-order consistency between these engines, the key-value store must be explicitly synced before writing to the freezer and vice versa. Fixes - ethereum#31405 - ethereum#29819
core, ethdb: introduce database sync function (ethereum#31703)
This pull request introduces a SyncKeyValue function to the ethdb.KeyValueStore
interface, providing the ability to forcibly flush all previous writes to disk.
This functionality is critical for go-ethereum, which internally uses two independent
database engines: a key-value store (such as Pebble, LevelDB, or memoryDB for
testing) and a flat-file–based freezer. To ensure write-order consistency between
these engines, the key-value store must be explicitly synced before writing to the
freezer and vice versa.
Fixes