Skip to content

Commit

Permalink
ethdb/pebble: fix nil callbacks (ethereum#26650)
Browse files Browse the repository at this point in the history
  • Loading branch information
karalabe authored Feb 9, 2023
1 parent bf1798e commit da3c974
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions ethdb/pebble/pebble.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ func (d *Database) onWriteStallEnd() {
// 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) (*Database, error) {
var db *Database
// Ensure we have some minimal caching and file guarantees
if cache < minCache {
cache = minCache
Expand All @@ -140,6 +139,11 @@ func New(file string, cache int, handles int, namespace string, readonly bool) (
if memTableSize > maxMemTableSize {
memTableSize = maxMemTableSize
}
db := &Database{
fn: file,
log: logger,
quitChan: make(chan chan error),
}
opt := &pebble.Options{
// Pebble has a single combined cache area and the write
// buffers are taken from this too. Assign all available
Expand Down Expand Up @@ -187,13 +191,8 @@ func New(file string, cache int, handles int, namespace string, readonly bool) (
if err != nil {
return nil, err
}
// Assemble the wrapper with all the registered metrics
db = &Database{
fn: file,
db: innerDB,
log: logger,
quitChan: make(chan chan error),
}
db.db = innerDB

db.compTimeMeter = metrics.NewRegisteredMeter(namespace+"compact/time", nil)
db.compReadMeter = metrics.NewRegisteredMeter(namespace+"compact/input", nil)
db.compWriteMeter = metrics.NewRegisteredMeter(namespace+"compact/output", nil)
Expand Down

0 comments on commit da3c974

Please sign in to comment.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy