policer: add check for repeated error logging #914
No reviewers
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
6 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#914
Loading…
Reference in a new issue
No description provided.
Delete branch "elebedeva/frostfs-node:fix/policer-error-log"
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?
Relates #110
processObject()
returns 3 types of errors:Every error will occur for all objects in container simultaneously, so we can log each error once and safely ignore the rest.
Signed-off-by: Ekaterina Lebedeva ekaterina.lebedeva@yadro.com
@ -71,2 +77,4 @@
}
}
func skipLog(errs []string, err string) bool {
I am sure this method works fine in your case :) And my change request is absolutely optional. But it works until incoming
err
gets wrapped for some reason by another error. So, better to not compare them like strings, but makeand then
Btw, another think to think about is that we can fail to connect to different nodes -- I would like to see this in logs.
But it is probably not too important -- if a node is isolated, lot's of other errors will occur.
@ -53,10 +57,12 @@ func (p *Policer) shardPolicyWorker(ctx context.Context) {
if p.objsInWork.add(addr.Address) {
err := p.processObject(ctx, addr)
processObject
can return errors not only from container build, but also because some nodes are unavailable.Can you give a list of errors (not full, just some groups) which we will ignore here?
It seems everything is ok, the last error is
return fmt.Errorf("%s: %w", logs.PolicerCouldNotBuildPlacementVectorForObject, err)
-- it will fail for all objects simultaneously, but some comment would still be nice, like "we can receive only 3 types of error, thus ignoring is safe".
Maybe even do this in the commit message.
@ -73,0 +79,4 @@
func skipLog(errs []string, err string) bool {
for _, strErr := range errs {
if strErr == err {
Are you sure this will work correctly? For pointer newly created pointer types (consider
fmt.Errorf
) we will havefalse
here.fixed
@ -51,3 +51,1 @@
var (
errMissingOID = fmt.Errorf("object ID is not set")
)
var errMissingOID = fmt.Errorf("object ID is not set")
It is a good change, but can we move it to a separate commit?
010d7fe87c
to8db3f747cc
8db3f747cc
toafd2ba9a66