Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pusher attempt delete #2974

Merged
merged 2 commits into from
May 24, 2022
Merged

fix: pusher attempt delete #2974

merged 2 commits into from
May 24, 2022

Conversation

istae
Copy link
Member

@istae istae commented May 20, 2022

Checklist

If a non-shallow receipt is received before the allowed 6 attempts, then with the current implementation, the key never gets deleted causing a leak.

  • I have read the coding guide
  • My change requires a documentation update and I have done it
  • I have added tests to cover my changes.

Description

Motivation and context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):


This change is Reviewable

@acud
Copy link
Member

acud commented May 23, 2022

I'm not entirely sure that this is desirable behavior. At some point we've turned on the skip list for successful pushes too, which should in theory result in (some) disjoint path traversal for repeated successful pushes of the same chunk. The key doesn't leak since it has a TTL and there are timely cleanups on the skip-list.

@istae
Copy link
Member Author

istae commented May 23, 2022

I'm not entirely sure that this is desirable behavior. At some point we've turned on the skip list for successful pushes too, which should in theory result in (some) disjoint path traversal for repeated successful pushes of the same chunk. The key doesn't leak since it has a TTL and there are timely cleanups on the skip-list.

@acud I think you were looking at a closed PR. This PR is related to the pusher package :)

@acud
Copy link
Member

acud commented May 23, 2022

oops wrong pacakge. sorry you're right. i'll review again

Copy link
Member

@acud acud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this change small but significant. Just spent a considerable amount of time trying to understand what it exactly does and how. It would be nice to have more comments about this, since this is not trivial.

if po < d && s.attempts.try(addr) {
s.metrics.ShallowReceiptDepth.WithLabelValues(strconv.Itoa(int(po))).Inc()
return fmt.Errorf("pusher: shallow receipt depth %d, want at least %d", po, d)
}
s.logger.Tracef("pusher: pushed chunk %s to node %s, receipt depth %d", addr, peer, po)
s.metrics.ReceiptDepth.WithLabelValues(strconv.Itoa(int(po))).Inc()
s.attempts.delete(addr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since checking the receipt is not synchronized with setting the chunk as synced, this might result in the chunk being pushed again in the timeframe between the delete and the setting of the chunk. not critical but can result in a bit of redundant operations

@istae istae added this to the 1.6.1 milestone May 24, 2022
@istae istae added the ready for review The PR is ready to be reviewed label May 24, 2022
@istae istae merged commit 56920dd into master May 24, 2022
@istae istae deleted the pusher-fix branch May 24, 2022 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull-request ready for review The PR is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants