forked from TrueCloudLab/frostfs-node
[#933] write-cache: Use real number of objects in counters
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
29955a3036
commit
616013cb8a
1 changed files with 6 additions and 3 deletions
|
@ -91,9 +91,12 @@ func (x *counters) Read() error {
|
||||||
|
|
||||||
x.cDB.Store(inDB)
|
x.cDB.Store(inDB)
|
||||||
|
|
||||||
// FIXME: calculate the actual value in FSTree (new method?).
|
inFS, err := x.fs.NumberOfObjects()
|
||||||
// For now we can think that db/fs = 50/50.
|
if err != nil {
|
||||||
x.cFS.Store(inDB)
|
return fmt.Errorf("could not read write-cache FS counter: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
x.cFS.Store(inFS)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue