-
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: limit goroutine creation in intent resolution #5219
Conversation
Rename some methods, clarify comments, and other minor API updates (remove unused arg and avoid mutating the passed-in error).
An explosion of these calls for the same transaction (or a small number of transactions) was responsible for cockroachdb#4925 Fixes cockroachdb#4925
This method adds channel-based backpressure to RunAsyncTask, to avoid spinning up an unbounded number of goroutines.
This is a last line of defense against issues like cockroachdb#4925.
Reviewed 3 of 3 files at r1, 5 of 5 files at r2, 3 of 3 files at r3, 2 of 2 files at r4, 1 of 1 files at r5, 1 of 1 files at r6, 2 of 2 files at r7, 1 of 1 files at r8. storage/intent_resolver.go, line 43 [r6] (raw file): Comments from the review on Reviewable.io |
Can you add (relatively) prominent logging in the case that the rate limiting or the transaction cache are triggered, at least for now? Is it certified that #4925 is still the intent issue? I haven't had a chance to investigate it after I disarmed the timestamp cache (so in the case I had seen, there were a million synchronous pushes triggered by the GC queue). Reviewed 3 of 3 files at r1, 5 of 5 files at r2, 3 of 3 files at r3, 2 of 2 files at r4, 1 of 1 files at r5, 1 of 1 files at r6, 2 of 2 files at r7, 1 of 1 files at r8. storage/intent_resolver.go, line 59 [r3] (raw file): storage/intent_resolver.go, line 162 [r3] (raw file): storage/intent_resolver.go, line 192 [r3] (raw file): storage/intent_resolver.go, line 156 [r6] (raw file): Some more comments here on the expected outcomes would be good (i.e. we assume the other guy's push goes through in time for us retrying the read/write). storage/intent_resolver.go, line 237 [r6] (raw file): Comments from the review on Reviewable.io |
LGTM Review status: all files reviewed at latest revision, 8 unresolved discussions, all commit checks successful. storage/intent_resolver.go, line 47 [r8] (raw file): storage/intent_resolver.go, line 155 [r8] (raw file): Comments from the review on Reviewable.io |
Review status: all files reviewed at latest revision, 9 unresolved discussions, all commit checks successful. storage/intent_resolver.go, line 75 [r8] (raw file): Comments from the review on Reviewable.io |
@tschottdorf The immediate problem in #4925 was goroutines created by Added logging at V(1) for a push that is skipped because it is in flight (it would be pretty noisy otherwise - it shows up 250 times in a run of All other comments addressed. Review status: 3 of 7 files reviewed at latest revision, 9 unresolved discussions. storage/intent_resolver.go, line 192 [r3] (raw file): storage/intent_resolver.go, line 43 [r6] (raw file): storage/intent_resolver.go, line 156 [r6] (raw file): storage/intent_resolver.go, line 237 [r6] (raw file): storage/intent_resolver.go, line 75 [r8] (raw file): storage/intent_resolver.go, line 155 [r8] (raw file): Comments from the review on Reviewable.io |
Reviewed 4 of 4 files at r9. Comments from the review on Reviewable.io |
Reviewed 4 of 4 files at r9. storage/intent_resolver.go, line 156 [r6] (raw file): Comments from the review on Reviewable.io |
Review status: all files reviewed at latest revision, 5 unresolved discussions, all commit checks successful. storage/intent_resolver.go, line 156 [r6] (raw file): Comments from the review on Reviewable.io |
Change map keys from pointers to values. Add logging. Wrap long lines and update comments.
6be1079
to
bae254c
Compare
Reviewed 1 of 1 files at r10. Comments from the review on Reviewable.io |
storage: limit goroutine creation in intent resolution
The method formerly known as
Replica.handleSkippedIntents
will no longer try to push transactions for which aPushTxn
call is already in flight. Additionally, there is now a hard limit on the number of async tasks that can be created in this area.Move methods related to intent resolution from
Store
andReplica
to a newintentResolver
type. Various cleanups, renamings, and refactorings to support these changes.Fixes #4925
This change is