Drop frostfs_node_engine_container_size_bytes
and ..._count_total
metric for removed containers #889
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#889
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:fix/drop_zero_metrics"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Now metrics
frostfs_node_engine_container_size_bytes
andfrostfs_node_engine_container_objects_total
for removed container will be deleted after container removal.Shard's GC checks every epoch metabase for containers with size = 0, checks container availability and size for this container on other shards, then deletes metric.
Also small refactoring for metabase inhume/delete: removed redundant fields, renamed counters.
Relates #864
@ -291,0 +307,4 @@
func (s *containerSource) IsContainerAvailable(ctx context.Context, id cid.ID) (bool, error) {
if s == nil || s.cs == nil {
return true, nil
By default all containers are available
6464d55743
toc516e58eaa
Dropto Dropfrostfs_node_engine_container_size_bytes
metric for removed containersfrostfs_node_engine_container_size_bytes
and..._count_total
metric for removed containers@ -291,0 +302,4 @@
}
type containerSource struct {
cs container.Source
Is it necessary to wrap
container.Source
in a new type?Yes.
container.Source
is an interface, butatomic.Value
doesn't support changing type. From docs:All calls to CompareAndSwap for a given Value must use values of the same concrete type.
@ -291,0 +320,4 @@
if err == nil {
return true, nil
}
if client.IsErrContainerNotFound(err) {
Get
is not enough, there should be aDeletionInfo
somewhere.Fixed
@ -262,0 +417,4 @@
}
}
func (e *StorageEngine) selectNonExistedIDs(ctx context.Context, ids []cid.ID) (map[cid.ID]struct{}, error) {
nonExistent
?Fixed
@ -483,0 +647,4 @@
return metaerr.Wrap(err)
}
// ZeroCountContainers returns containers with count = 0.
It is not obvious, what
count
is from the comment.Fixed
80a25a549d
to0cd1bc08fe
0cd1bc08fe
toef8328176e
@ -262,0 +271,4 @@
return
}
if len(idMap) == 0 {
Is this check really necessary?
Yes: container may be empty, but still exist
Accidentally approved the PR.
ef8328176e
to9bc8c45e74
@ -291,0 +305,4 @@
cs container.Source
}
func (s *containerSource) IsContainerAvailable(ctx context.Context, id cid.ID) (bool, error) {
WasRemoved
arguably serves the same purpose, but with inverted result. Isn't it enough? Like we only want to remove metric ifWasRemoved
returnstrue, nil
.Fixed
@ -483,0 +693,4 @@
return result, nil
}
func (db *DB) DeleteContainerCount(ctx context.Context, id cid.ID) error {
Why are
DeleteContainerCount
andDeleteContainerSize
separate methods? It seems they become 0 simultaneously and are removed together too.Nope, count may have non zero
phy
counter, but size (it is logical size) is already 0.9bc8c45e74
toaec318b414
@ -219,2 +221,4 @@
rebuildWorkersCount uint32
containerSource atomic.Value // type containerSource
Btw, why is it not
atomic.Pointer
?old school, fixed.
aec318b414
to4b8b4da681