frostfs-node/pkg
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
..
ape [#1613] morph: Add tracing for morph queries to neo-go 2025-02-05 16:38:20 +03:00
core [#1613] morph: Add tracing for morph queries to neo-go 2025-02-05 16:38:20 +03:00
innerring [#1613] morph: Add tracing for morph queries to neo-go 2025-02-05 16:38:20 +03:00
local_object_storage [#1648] writecache: Fix race condition when reporting cache size metrics 2025-02-19 17:05:40 +03:00
morph [#1613] morph: Add tracing for morph queries to neo-go 2025-02-05 16:38:20 +03:00
network [#1608] qos: Add client grpc interceptors 2025-02-07 15:43:04 +03:00
services [#1608] tree: Add IO tag for tree sync requests 2025-02-07 15:43:06 +03:00
tracing [#146] node: Add trace_id to logs 2023-09-27 11:05:27 +03:00
util [#1608] logger: Add IO tag logging 2025-02-07 15:43:03 +03:00