Conversation
bwplotka
left a comment
There was a problem hiding this comment.
I think the problem is a bit different here.
When I think about it I think what is happening is that we don't cancel the context here, however, context is still chained(!).
I think what would fix this problem would be actually starting new context for forwarding and then cancel it only if timeout OR ((not yet success or failure) && parent context is cancelled). WDYT?
This would have major benefit of knowing best effort forwards status properly and replication status is visible by write error / success no? cc @squat
|
In other words what I mean is that |
|
@bwplotka Yes, eventually that's the result. We can use that metric instead of adding a new one. I just wanted to be more explicit about the metric.
For me, this is just a misleading metric issue. Rather than detaching the forward requests from the incoming request's context, I would suggest to catch this case and handle it different than an error. |
|
You cannot catch cancellation in any other way than having separate context ): |
|
It's not error handling, it's premature context cancel from parent IMO |
|
@squat has pointed out offline that we have multiple replication batch operations per request so |
f4a98ff to
30e4c7e
Compare
brancz
left a comment
There was a problem hiding this comment.
Really awesome! Nothing to complain :D
Will leave for one more review though as this is a rather large change.
bwplotka
left a comment
There was a problem hiding this comment.
Looks good! Just some small nits 🤗
Thanks!
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
b800021 to
cb03c7b
Compare
This PR adds a new metric to track replication behaviour. Previously,
thanos_receive_forward_requests_totalwas used. However, that metric is now misleading because we have recently changed how replication behaves (#2621).Changes
thanos_receive_replications_totalfd04971thanos_forward_requests_total0aa495dVerification
make test-localmake examplesmake example-rules-lintcc @krasi-georgiev