cockroachdb / cockroachdb/cockroach
Unexpected crash when creating a changefeed query
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
**Describe the problem**
Cockroach crashed when creating a changefeed query
Please describe the issue you observed, and any steps we can take to reproduce it:
I set up a local dev env w/ CRDB/Kafka/ Schema registry in Docker and like to create a cdc query. But it crashed unexpectedly.
**To Reproduce**
cockroach sql --url 'postgres://127.0.0.1:26257?sslmode=disable'
set cluster setting kv.rangefeed.enabled = true;
SET CLUSTER SETTING cluster.organization = 'xxx';
SET CLUSTER SETTING enterprise.license = 'xxxxxxx';
Create table test (k int primary key, v int);
CREATE EXTERNAL CONNECTION kafka AS "kafka://broker1:29092";
CREATE EXTERNAL CONNECTION registry AS "http://schema-registry:8081";
create changefeed with format=avro, confluent_schema_registry = "external://registry",
envelope=bare as select k, v+1 from test;
Got following error when trying to create the changefeed
ERROR: internal error: could not find avro field for column ?column?
SQLSTATE: XX000
DETAIL: stack trace:
github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/avro.go:855: func1()
github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/cdcevent/event.go:194: forEachDatum()
github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/cdcevent/event.go:640: Datum()
github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/avro.go:851: nativeFromRow()
github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/avro.go:992: BinaryFromRow()
github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/encoder_avro.go:293: EncodeValue()
github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/event_processing.go:446: encodeAndEmit()
github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/event_processing.go:387: ConsumeEvent()
github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/changefeed_processors.go:605: tick()
github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/changefeed_processors.go:560: Next()
github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/changefeed_processors.go:1199: Next()
github.com/cockroachdb/cockroach/pkg/sql/execinfra/base.go:193: Run()
github.com/cockroachdb/cockroach/pkg/sql/execinfra/processorsbase.go:726: Run()
github.com/cockroachdb/cockroach/pkg/sql/flowinfra/flow.go:580: Run()
github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:902: Run()
github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/changefeed_dist.go:328: func3()
github.com/cockroachdb/cockroach/pkg/util/ctxgroup/ctxgroup.go:168: func1()
golang.org/x/sync/errgroup/external/org_golang_x_sync/errgroup/errgroup.go:75: func1()
GOROOT/src/runtime/asm_amd64.s:1594: goexit()
HINT: You have encountered an unexpected error.
Please check the public issue tracker to check whether this problem is
already tracked. If you cannot find it there, please report the error
with details by creating a new issue.
If you would rather not post publicly, please contact us directly
using the support form.
We appreciate your feedback.
**Expected behavior**
successfully create the changefeed or provide clear error message. Don't crash!
**Additional data / screenshots**
If the problem is SQL-related, include a copy of the SQL query and the schema
of the supporting tables.
If a node in your cluster encountered a fatal error, supply the contents of the
log directories (at minimum of the affected node(s), but preferably all nodes).
Note that log files can contain confidential information. Please continue
creating this issue, but contact support@cockroachlabs.com to submit the log
files in private.
If applicable, add screenshots to help explain your problem.
**Environment:**
- CockroachDB version [e.g. 23.1.14]
- Server OS: [Docker]
- Client app [`cockroach sql`]
**Additional context**
What was the impact?
It's confusing to users
Add any other context about the problem here.
Jira issue: CRDB-35801
Contributor guide
Assessment
This issue has not been assessed yet.