-
Notifications
You must be signed in to change notification settings - Fork 340
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
pusher: retry shallow receipts #2049
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @acud)
pkg/pusher/pusher.go, line 161 at r1 (raw file):
po := swarm.Proximity(ch.Address().Bytes(), storerPeer.Bytes()) s.metrics.ReceiptDepth.WithLabelValues(strconv.Itoa(int(po))).Inc() delete(retryCounter, ch.Address().ByteString())
Shouldn't be the delete operation also guarded with the mtx
mutex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @acud)
445b47d
to
5505e00
Compare
d := s.depther.NeighborhoodDepth() | ||
if po < d { | ||
mtx.Lock() | ||
retryCounter[ch.Address().ByteString()]++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
increment after the check with the counter. Otherwise you will effectively only retry retryCount-1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we already retried, this is the correct thing to do. you can double check
6800168
to
bcb5f44
Compare
c14b840
to
ec483b9
Compare
This PR somehow revealed a data race on the logger that is shared between goroutines https://github.com/ethersphere/bee/pull/2049/checks?check_run_id=2820412618#step:10:5875. |
94d4c86
to
dd759ce
Compare
This change makes pusher push chunks for which we've received shallow receipts multiple times to try and get them stored deeper. This is a naive implementation that can be elaborate later on to attempt different traces somehow.
unit tests still TODO
This change is