frostfs-node/pkg/local_object_storage
Aleksey Savchuk 02f3a7f65c
[#1648] writecache: Fix race condition when reporting cache size metrics
There is a race condition when multiple cache operation try to report
the cache size metrics simultaneously. Consider the following example:
- the initial total size of objects stored in the cache size is 2
- worker X deletes an object and reads the cache size, which is 1
- worker Y deletes an object and reads the cache size, which is 0
- worker Y reports the cache size it learnt, which is 0
- worker X reports the cache size it learnt, which is 1

As a result, the observed cache size is 1 (i. e. one object remains
in the cache), which is incorrect because the actual cache size is 0.

To fix this, let's report the metrics periodically in the flush loop.

Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
2025-02-19 17:05:40 +03:00
..
blobovnicza [#1620] logs: Drop redundant trace_id fields 2025-01-29 16:13:51 +03:00
blobstor [#1624] blobovniczatree: Return source error from Init() 2025-02-03 17:36:21 +03:00
engine [#1613] morph: Add tracing for morph queries to neo-go 2025-02-05 16:38:20 +03:00
internal [#1437] node: Fix contextcheck linter 2024-11-13 10:36:10 +03:00
metabase [#1608] qos: Add qos service to adjust incoming IO tags 2025-02-07 15:43:03 +03:00
metrics [#1367] fstree: Add IterateInfo method 2024-09-12 15:06:33 +03:00
pilorama [#1606] Use slices.Clone()/bytes.Clone() where possible 2025-01-17 14:50:14 +03:00
shard [#1608] shard: Add IO tag for rebuild 2025-02-07 15:43:07 +03:00
util [#1103] node: Implement Get\Head requests for EC object 2024-04-24 18:15:53 +03:00
writecache [#1648] writecache: Fix race condition when reporting cache size metrics 2025-02-19 17:05:40 +03:00