-
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
release-22.1: sql: audit all processors to make their closure bullet-proof #92362
release-22.1: sql: audit all processors to make their closure bullet-proof #92362
Conversation
This commit replaces all usages of `ProcessorBaseNoHelper.Ctx` field with a call to the newly-introduced `Ctx()` method which returns a background context if the processor hasn't been started. This change makes it so that all processors now respect the contract of `colexecop.Closer` interface which says that `Close` must be safe to call even if `Init` hasn't been performed (in the context of processors this means that `Columnarizer.Init` wasn't called meaning that `Processor.Start` wasn't either). Initially, I attempted to fix this in cockroachdb#91446 by putting the protection into the columnarizer, but that led to broken assumptions since we wouldn't close all closers that we expected to (in particular, the materializer that is the input to the wrapped row-by-row processor wouldn't be closed). This commit takes a different approach and should fix the issue for good without introducing any flakiness. As a result, this commit fixes a rarely hit issue when the aggregator and the zigzag joiner attempt to log when they are closed if they haven't been started (that we see occasionally from sentry). The issue is quite rare though, so no release note seems appropriate. Release note: None
Thanks for opening a backport. Please check the backport criteria before merging:
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
Add a brief release justification to the body of your PR to justify this backport. Some other things to consider:
|
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.
(perhaps this should bake on master for a bit, though?)
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @cucaroach)
Yes, I want to let it bake on master for a week or so.. |
Looks like there hasn't been any fallout, merging. |
Backport 1/1 commits from #91969.
/cc @cockroachdb/release
This commit replaces all usages of
ProcessorBaseNoHelper.Ctx
fieldwith a call to the newly-introduced
Ctx()
method which returnsa background context if the processor hasn't been started. This change
makes it so that all processors now respect the contract of
colexecop.Closer
interface which says thatClose
must be safe tocall even if
Init
hasn't been performed (in the context of processorsthis means that
Columnarizer.Init
wasn't called meaning thatProcessor.Start
wasn't either).Initially, I attempted to fix this in #91446 by putting the protection
into the columnarizer, but that led to broken assumptions since we
wouldn't close all closers that we expected to (in particular, the
materializer that is the input to the wrapped row-by-row processor
wouldn't be closed). This commit takes a different approach and should
fix the issue for good without introducing any flakiness.
As a result, this commit fixes a rarely hit issue when the aggregator
and the zigzag joiner attempt to log when they are closed if they
haven't been started (that we see occasionally from sentry). The issue
is quite rare though, so no release note seems appropriate.
Fixes: #84902.
Fixes: #91845.
Release note: None
Release justification: low-risk bug fix.