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

colexec: create new message to send metadata in unordered synchronizer #53018

Merged
merged 1 commit into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions pkg/sql/colexec/parallel_unordered_synchronizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ import (
"github.com/cockroachdb/errors"
)

// unorderedSynchronizerMsg is a light wrapper over a coldata.Batch sent over a
// channel so that the main goroutine can know which input this message
// originated from.
// unorderedSynchronizerMsg is a light wrapper over a coldata.Batch or metadata
// sent over a channel so that the main goroutine can know which input this
// message originated from.
// Note that either a batch or metadata must be sent, but not both.
type unorderedSynchronizerMsg struct {
inputIdx int
b coldata.Batch
Expand Down Expand Up @@ -237,6 +238,11 @@ func (s *ParallelUnorderedSynchronizer) init(ctx context.Context) {
// In case of a zero-length batch, proceed to drain the input.
fallthrough
case parallelUnorderedSynchronizerStateDraining:
// Create a new message for metadata. The previous message cannot be
// overwritten since it might still be in the channel.
msg = &unorderedSynchronizerMsg{
inputIdx: inputIdx,
}
if input.MetadataSources != nil {
msg.meta = input.MetadataSources.DrainMeta(ctx)
}
Expand Down
1 change: 0 additions & 1 deletion pkg/sql/rowexec/processors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,6 @@ func TestUncertaintyErrorIsReturned(t *testing.T) {
testutils.RunTrueAndFalse(t, "vectorize", func(t *testing.T, vectorize bool) {
vectorizeOpt := "off"
if vectorize {
skip.WithIssue(t, 52948)
vectorizeOpt = "on"
}
for _, testCase := range testCases {
Expand Down