[#1413] engine: Remove error counting methods from Shard

All error counting and hangling logic is present on the engine level.
Currently, we pass engine metrics with shard ID metric to shard, then
export 3 methods to manipulate these metrics.
In this commits all methods are removed and error counter is tracked on
the engine level exlusively.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-10-04 15:07:20 +03:00
parent 963faa615a
commit 4dc9a1b300
4 changed files with 4 additions and 25 deletions

View file

@ -217,7 +217,7 @@ func (e *StorageEngine) removeShards(ids ...string) {
continue
}
sh.DeleteShardMetrics()
e.metrics.DeleteShardMetrics(id)
ss = append(ss, sh)
delete(e.shards, id)
@ -318,7 +318,7 @@ func (e *StorageEngine) SetShardMode(id *shard.ID, m mode.Mode, resetErrorCounte
if id.String() == shID {
if resetErrorCounter {
sh.errorCount.Store(0)
sh.Shard.ClearErrorCounter()
e.metrics.ClearErrorCounter(shID)
}
return sh.SetMode(m)
}
@ -422,7 +422,7 @@ func (e *StorageEngine) deleteShards(ids []*shard.ID) ([]hashedShard, error) {
for _, sh := range ss {
idStr := sh.ID().String()
sh.DeleteShardMetrics()
e.metrics.DeleteShardMetrics(idStr)
delete(e.shards, idStr)