-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
storage: more quota pool deadlocks #17826
Comments
Unfortunately, this doesn't look like it's the same issue that #17796 was addressing. There are certainly goroutines hung in /cc @irfansharif |
Yeah, there were a couple lines like "have been waiting 15m0s attempting to acquire quota" in the logs. Didn't your timer PR fix things so that the I dumped the goroutines several times; occasionally, you'd see one listed as |
Any down nodes? Any slow nodes? @nvanbenschoten there's a good argument here against the periodic logging we just introduced -- it'll break the nice property that we previously had, which is that we get the |
Nope, all nodes were up. What do you mean by slow nodes? The deadlocked node was pretty unresponsive by the end but wasn't slow before that. |
@irfansharif has kindly volunteered to look into this further. Logs and goroutine stacks from a node exhibiting this deadlock captured here: https://gist.github.com/benesch/c747301192eb984686fb60fccf24c506. @irfansharif, to repro, run
on my quota-pool-deadlock branch. This'll create 10 VMs on GCE, so best not to leave the cluster lying around too long. To force-delete all locally-created terraform clusters:
|
First pass at this running We do however cap the acquired quota at a pre-specified maximum value (see here) so other than being horridly slow this shouldn't have caused a problem. Will try with larger commands capping out quota acquisitions. |
btw, @nvanbenschoten and I were wondering about something else recently - if a node goes down, will we (pretty much) immediately lock down the remaining replicas as well since they'll run out of quota? Presumably that would be the case until we transfer the replica off the dead node, but that may take a very long time. Am I forgetting about a mechanism that alleviates this? |
I have a faded memory that we avoid quota when the RPC connections to that node aren't healthy. Mind pointing me at this if it's real? |
you're looking for this: cockroach/pkg/storage/replica.go Line 975 in b085a91
Assuming we start at steady state with three nodes, when a node goes down the remaining two will make forward progress writing out up to |
Spitballing here, but this TODO seems ominous: cockroach/pkg/storage/replica.go Lines 904 to 909 in b085a91
|
This was an oversight introduced in cockroachdb#15802, the `undoQuotaAcquisition` was intended to be used for all proposal errors but we seem to have skipped the very first one. It seems to have been a relic of the earlier structure where in the event of proposal errors the acquired quota was released within `Replica.propose` itself, and not left to the caller. Fixes (hopefully) cockroachdb#17826.
I'm able to fairly reliably reproduce a deadlock in the quota pool while performing a ten-node, 2TB restore. Looks very much like #17524, except that #17796 doesn't seem to fix the problem. On the node coordinating the restore, we see a hung goroutine:
On the node processing that split, there's a whole bunch of hung goroutines, plus a whole lot of goroutines in
quotaPool.acquire
: https://gist.github.com/benesch/c747301192eb984686fb60fccf24c506I'm running with a relatively recent version of #17796, though not exactly the version that merged. https://github.com/benesch/cockroach/tree/quota-pool-deadlock
The text was updated successfully, but these errors were encountered: