Skip to content

importer: fix output type mismatch in distmerge flow planning#165254

Merged
trunk-io[bot] merged 1 commit intocockroachdb:masterfrom
mw5h:mw5h/fix-distmerge-plan-output-types
Mar 9, 2026
Merged

importer: fix output type mismatch in distmerge flow planning#165254
trunk-io[bot] merged 1 commit intocockroachdb:masterfrom
mw5h:mw5h/fix-distmerge-plan-output-types

Conversation

@mw5h
Copy link
Contributor

@mw5h mw5h commented Mar 9, 2026

PR #164536 moved SST metadata from the import processor's third output
column to the progress metadata channel. PR #164977 updated the
processor's own output type declaration (importProcessorOutputTypes)
from 3 to 2 columns, but missed the separate output type declaration
in import_processor_planning.go used to build the physical plan.

This caused the receiver (gateway node) to set up a StreamDecoder
expecting 3 columns via InputSyncSpec.ColumnTypes, while the producer
sent 2-column rows. When the gateway decoded the row, it panicked with
index out of range [2] with length 2 in StreamDecoder.GetRow,
crashing the node.

Fix by using importProcessorOutputTypes (the single source of truth)
in the flow plan instead of a separate local variable.

Fixes: #165147
Epic: CRDB-48845

Release note: None

@trunk-io
Copy link
Contributor

trunk-io bot commented Mar 9, 2026

😎 Merged successfully - details.

@blathers-crl
Copy link

blathers-crl bot commented Mar 9, 2026

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

PR cockroachdb#164536 moved SST metadata from the import processor's third output
column to the progress metadata channel. PR cockroachdb#164977 updated the
processor's own output type declaration (importProcessorOutputTypes)
from 3 to 2 columns, but missed the separate output type declaration
in import_processor_planning.go used to build the physical plan.

This caused the receiver (gateway node) to set up a StreamDecoder
expecting 3 columns via InputSyncSpec.ColumnTypes, while the producer
sent 2-column rows. When the gateway decoded the row, it panicked with
"index out of range [2] with length 2" in StreamDecoder.GetRow,
crashing the node.

Fix by using importProcessorOutputTypes (the single source of truth)
in the flow plan instead of a separate local variable.

Fixes: cockroachdb#165147
Epic: CRDB-48845

Release note: None
@mw5h mw5h force-pushed the mw5h/fix-distmerge-plan-output-types branch from e22b4a0 to fe74af9 Compare March 9, 2026 21:05
@mw5h mw5h marked this pull request as ready for review March 9, 2026 21:58
@mw5h mw5h requested a review from a team as a code owner March 9, 2026 21:58
@mw5h mw5h requested review from spilchen and yuzefovich and removed request for a team March 9, 2026 21:58
Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

@yuzefovich reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on spilchen).

@trunk-io trunk-io bot merged commit 5968526 into cockroachdb:master Mar 9, 2026
41 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

roachtest: import/cancellation/distmerge=true/nodes=4 failed

3 participants