diff --git a/db.go b/db.go index eb8a3b85b..3065837f4 100644 --- a/db.go +++ b/db.go @@ -477,7 +477,7 @@ func (db *DB) IsClosed() bool { func (db *DB) close() (err error) { db.opt.Debugf("Closing database") - db.opt.Infof("Lifetime L0 stalled for: %s\n", time.Duration(db.lc.l0stallsMs)) + db.opt.Infof("Lifetime L0 stalled for: %s\n", time.Duration(atomic.LoadInt64(&db.lc.l0stallsMs))) atomic.StoreInt32(&db.blockWrites, 1) diff --git a/levels.go b/levels.go index 0b3950817..49f7ccbe8 100644 --- a/levels.go +++ b/levels.go @@ -41,13 +41,13 @@ import ( type levelsController struct { nextFileID uint64 // Atomic + l0stallsMs int64 // Atomic // The following are initialized once and const. levels []*levelHandler kv *DB - cstatus compactStatus - l0stallsMs int64 + cstatus compactStatus } // revertToManifest checks that all necessary table files exist and removes all table files not