ethdb/pebble: set metric namespace correctly (#32563)

Ensure Database.namespace is initialized in pebble.New(...). Without
this, the write-stall metrics registered in onWriteStallBegin/End are
emitted without the intended namespace prefix, while other Pebble
metrics use the provided constructor parameter. This aligns stall
metrics with the rest of the Pebble metric set and fixes inconsistent
metric naming.

---------

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
This commit is contained in:
GarmashAlex 2025-09-11 11:05:17 +03:00 committed by GitHub
parent 046e2cd7a4
commit 92fbbe63c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -218,9 +218,10 @@ func New(file string, cache int, handles int, namespace string, readonly bool) (
memTableSize = maxMemTableSize - 1
}
db := &Database{
fn: file,
log: logger,
quitChan: make(chan chan error),
fn: file,
log: logger,
quitChan: make(chan chan error),
namespace: namespace,
// Use asynchronous write mode by default. Otherwise, the overhead of frequent fsync
// operations can be significant, especially on platforms with slow fsync performance