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

kv: increase dist sender's RPC timeout #16088

Merged
merged 3 commits into from
May 24, 2017
Merged

kv: increase dist sender's RPC timeout #16088

merged 3 commits into from
May 24, 2017

Conversation

tamird
Copy link
Contributor

@tamird tamird commented May 23, 2017

No description provided.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@spencerkimball spencerkimball left a comment

Choose a reason for hiding this comment

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

Yes, I'm not too worried about this change. This is a relatively rare occurrence and I'm not convinced there's going to be a big win to allow these ambiguous results to return after a wait. In those cases, it's likely that the live node (live because gRPC heartbeats are still working) is blocked up in a Raft group or similar. In those cases, there are all kinds of other problems, so letting this pending request continue waiting isn't likely to make the system more responsive.

@andreimatei
Copy link
Contributor

FWIW, I think what we want for the DistSender timeouts is some mechanism to differentiate between slow RPCs that have been accepted by the lease holder versus RPCs that haven't even been accepted yet (and thus we don't really know if the recipient even is the leaseholder). In lack of that, I always disliked those timeouts, so I think this change is great.

@bdarnell
Copy link
Contributor

This isn't the timeout you want to remove - This controls how long we wait when we already have multiple RPCs in flight, so removing it means we'll wait as long as it takes for them to complete. You want to remove SendNextTimeout to avoid having multiple RPCs in flight in the first place.


Review status: 0 of 1 files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from Reviewable

@tbg
Copy link
Member

tbg commented May 24, 2017

@bdarnell I also chatted with @tamird because I thought the PR description suggested that's what he wanted to do, but it seems intentional that he's only removing this smaller bit now (which to me seems also reasonable, and perhaps less contentious). Perhaps the PR message should be clarified though.

@bdarnell
Copy link
Contributor

Ah. Well in that case I disagree with this change. The reliance on a single leader means that we may not need to send RPCs to multiple replicas, but having sent them, they may be slow and we should use timeouts when waiting on secondary RPC attempts.

}
} else if pendingCall.Reply.Error == nil {
return pendingCall.Reply, nil
for ; pending > 0; pending-- {
Copy link
Member

Choose a reason for hiding this comment

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

There's actually no point in waiting for these pending RPCs unless haveCommit is true. Let's change this line to:

for ; haveCommit && pending > 0; pending-- {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@spencerkimball
Copy link
Member

I think @bdarnell has a point: removing this timeout entirely means a client can become permanently stuck if a range is jammed and not processing Raft commands. I think it might make more sense to increase the value of the timeout instead (perhaps to 10s?). @tamird's main concern is that this is breaking benchmarking because we do end up with sloooooow RPCs in some cases.

We can rely on the gRPC heartbeat timeout to cover the case of a connection which has become too unhealthy to serve RPCs. That's a 3s timeout. Let's leave this code in place and up the timeout to further attenuate occurrences of AmbiguousResultError while also protecting clients from permanent "black hole" ranges.

Also, @tamird, please note my comment around haveCommit being used to avoid waiting at all for pending RPCs.

@petermattis
Copy link
Collaborator

This could only break multi-node benchmarks, right? If this is somehow affecting single-node benchmarks I think there is a bug somewhere.

@tamird
Copy link
Contributor Author

tamird commented May 24, 2017

Revised this to increase the timeout instead of removing it, PTAL

@tamird
Copy link
Contributor Author

tamird commented May 24, 2017

@petermattis indeed, only affects multi-node benchmarks.

@tamird tamird changed the title kv: remove dist sender's RPC timeout kv: increase dist sender's RPC timeout May 24, 2017
@petermattis
Copy link
Collaborator

@tamird The multi-node sql benchmarks are somewhat uninteresting in that the nodes are all running on the same machine. That's not to dissuade this PR, but to help you unblock the benchmark storage work. I'd be fine in the short term with only recording the single-node sql benchmarks.

@tamird
Copy link
Contributor Author

tamird commented May 24, 2017 via email

@spencerkimball
Copy link
Member

lgtm

@bdarnell
Copy link
Contributor

:lgtm:


Reviewed 6 of 7 files at r3, 1 of 2 files at r4, 1 of 1 files at r5.
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks pending.


Comments from Reviewable

This timeout is believed to protect against hanging RPCs. Unfortunately
whenever such an abandonment takes place, an ambiguous result error is
returned to the client, which can be difficult to deal with.

This greatly increases the timeout in the hope of reducing these errors
at the expense of tail latencies. The upshot is that if such hanging
RPCs are common, we'll be able to track them down.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants