Fix container counters metrics removal #941

Merged
dstepanov-yadro merged 2 commits from dstepanov-yadro/frostfs-node:fix/container_counters into master 2024-09-04 19:51:06 +00:00

Relates #938

Scenario:

  1. Policer inhumes objects of removed container, size metric becomes 0
  2. GC removes metric
  3. GC removes physical objects of the removed container and updates metric (sets size=0), metric appears again

Fix:

  1. Do not update metrics if value (size or count) is zero
  2. Delete size records in DB (doesn't relate to bug, but it is bug anyway).
Relates #938 Scenario: 1. Policer inhumes objects of removed container, `size` metric becomes 0 2. GC removes metric 3. GC removes physical objects of the removed container and updates metric (sets `size=0`), metric appears again Fix: 1. Do not update metrics if value (`size` or `count`) is zero 2. Delete size records in DB (doesn't relate to bug, but it is bug anyway).
dstepanov-yadro added 2 commits 2024-01-30 09:45:15 +00:00
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
[#938] shard: Update only changed counters
All checks were successful
DCO action / DCO (pull_request) Successful in 5m40s
Vulncheck / Vulncheck (pull_request) Successful in 5m33s
Tests and linters / Staticcheck (pull_request) Successful in 7m12s
Build / Build Components (1.21) (pull_request) Successful in 7m25s
Build / Build Components (1.20) (pull_request) Successful in 7m29s
Tests and linters / Lint (pull_request) Successful in 8m26s
Tests and linters / Tests (1.20) (pull_request) Successful in 9m48s
Tests and linters / Tests with -race (pull_request) Successful in 9m56s
Tests and linters / Tests (1.21) (pull_request) Successful in 10m10s
675eec91f3
If metric value hasn't changed, but we update metric, then
non existed metric will apear with zero value.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
dstepanov-yadro requested review from storage-core-committers 2024-01-30 10:02:30 +00:00
dstepanov-yadro requested review from storage-core-developers 2024-01-30 10:02:30 +00:00
aarifullin approved these changes 2024-01-30 10:12:04 +00:00
acid-ant approved these changes 2024-01-30 10:16:49 +00:00
dstepanov-yadro merged commit 675eec91f3 into master 2024-01-30 10:27:24 +00:00
dstepanov-yadro deleted branch fix/container_counters 2024-01-30 10:27:27 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#941
No description provided.