shard: ReviveObject does not update shard metrics

オープン
#4,309 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go
領域
databases

調査の方向性

Start in pkg/local_object_storage/shard/revive.go at Shard.ReviveObject, then read metabase.ReviveObject in pkg/local_object_storage/metabase/revive.go around the gc counter decrement and reviveCounters. Compare with how deleteObjs applies a CountersDiff to the shard gauges. Done when a revive updates the object_counter, engine_payload_size and container_size metrics to match the metabase counters, with a test covering it.

索引モデルが issue の本文から書いたものです。

説明

Current Behavior

Shard.ReviveObject (shard/revive.go#L22) calls metabase.ReviveObject. That call changes the metabase counters: gc -1 at metabase/revive.go#L125, plus phy/root/payload through reviveCounters. It returns only a ReviveStatus and no CountersDiff, so the shard never adjusts its gauges. After a revive, neofs_node_object_counter{type="gc"} stays one too high for good, because the mark is removed and nothing will ever decrement it. neofs_node_engine_payload_size and container_size stay low by the object's payload, so a later delete pushes them down further.

Expected Behavior

The gauges follow the metabase counters through a revive, the same way they do through put, delete and mark.

Possible Solution

Have metabase.ReviveObject return the CountersDiff it applies, and apply it in Shard.ReviveObject like deleteObjs does.

Context

This can only happen through the control service (object revive). Found while analysing #4308.

主要言語
Go
スター
37
フォーク
56
平均マージ
1日 21時間
マージ済み PR(30日)
46

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nspcc-dev/neofs-node のほかの issue

nspcc-dev/neofs-node の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。