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

change data capture breaking with redpanda #64842

Closed
ghost opened this issue May 6, 2021 · 15 comments
Closed

change data capture breaking with redpanda #64842

ghost opened this issue May 6, 2021 · 15 comments
Assignees
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-community Originated from the community X-blathers-triaged blathers was able to find an owner

Comments

@ghost
Copy link

ghost commented May 6, 2021

Cluster working, message working when created using kafka/bin/kafka-console-producer.sh or rpk topic produce names

tail -f /run/cockroachdb/logs/cockroach.log

I210506 21:26:46.124938 228 server/status/runtime.go:525 ⋮ [n1] runtime stats: 1.7 GiB RSS, 271 goroutines, 183 MiB/814 MiB/480 MiB GO alloc/idle/total, 84 MiB/131 MiB CGO alloc/total, 0.4 CGO/sec, 2.7/0.6 %(u/s)time, 0.0 %gc (0x), 196 KiB/306 KiB (r/w)net
I210506 21:26:48.139963 86945049 vendor/github.com/Shopify/sarama/client.go:127 ⋮ [kafka-producer] ‹Initializing new client›
I210506 21:26:48.140030 86945049 vendor/github.com/Shopify/sarama/client.go:775 ⋮ [kafka-producer] client/metadata fetching metadata for all topics from broker ‹10.154.0.7:9092›
I210506 21:26:48.140379 87004726 vendor/github.com/Shopify/sarama/broker.go:213 ⋮ [kafka-producer] Connected to broker at ‹10.154.0.7:9092› (unregistered)
I210506 21:26:48.140675 86945049 vendor/github.com/Shopify/sarama/client.go:534 ⋮ [kafka-producer] client/brokers registered new broker #0 at ‹10.154.0.7:9092›
I210506 21:26:48.140698 86945049 vendor/github.com/Shopify/sarama/client.go:534 ⋮ [kafka-producer] client/brokers registered new broker esl/betmeta#3 at ‹10.154.0.25:9092›
I210506 21:26:48.140706 86945049 vendor/github.com/Shopify/sarama/client.go:534 ⋮ [kafka-producer] client/brokers registered new broker esl/betmeta#2 at ‹10.154.0.11:9092›
I210506 21:26:48.140712 86945049 vendor/github.com/Shopify/sarama/client.go:534 ⋮ [kafka-producer] client/brokers registered new broker esl/betmeta#1 at ‹10.154.0.9:9092›
I210506 21:26:48.140729 86945049 vendor/github.com/Shopify/sarama/client.go:174 ⋮ [kafka-producer] ‹Successfully initialized new client›
I210506 21:26:48.140775 86945049 vendor/github.com/Shopify/sarama/client.go:127 ⋮ [kafka-producer] ‹Initializing new client›
I210506 21:26:48.140799 86945049 vendor/github.com/Shopify/sarama/client.go:775 ⋮ [kafka-producer] client/metadata fetching metadata for all topics from broker ‹10.154.0.7:9092›
I210506 21:26:48.141010 87004734 vendor/github.com/Shopify/sarama/broker.go:213 ⋮ [kafka-producer] Connected to broker at ‹10.154.0.7:9092› (unregistered)
I210506 21:26:48.141464 86945049 vendor/github.com/Shopify/sarama/client.go:534 ⋮ [kafka-producer] client/brokers registered new broker #0 at ‹10.154.0.7:9092›
I210506 21:26:48.141486 86945049 vendor/github.com/Shopify/sarama/client.go:534 ⋮ [kafka-producer] client/brokers registered new broker esl/betmeta#3 at ‹10.154.0.25:9092›
I210506 21:26:48.141501 86945049 vendor/github.com/Shopify/sarama/client.go:534 ⋮ [kafka-producer] client/brokers registered new broker esl/betmeta#2 at ‹10.154.0.11:9092›
I210506 21:26:48.141511 86945049 vendor/github.com/Shopify/sarama/client.go:534 ⋮ [kafka-producer] client/brokers registered new broker esl/betmeta#1 at ‹10.154.0.9:9092›
I210506 21:26:48.141530 86945049 vendor/github.com/Shopify/sarama/client.go:174 ⋮ [kafka-producer] ‹Successfully initialized new client›
I210506 21:26:48.141998 87004736 ccl/changefeedccl/schemafeed/schema_feed.go:500 ⋮ [n1,job=656224550401802241] validate ‹88:1@1620334216.493522744,0›
I210506 21:26:48.147694 87004822 vendor/github.com/Shopify/sarama/async_producer.go:710 ⋮ [kafka-producer] producer/broker/1 starting up
I210506 21:26:48.147736 87004822 vendor/github.com/Shopify/sarama/async_producer.go:721 ⋮ [kafka-producer] producer/broker/1 state change to [open] on ‹names›/0
I210506 21:26:48.148013 87004821 vendor/github.com/Shopify/sarama/broker.go:211 ⋮ [kafka-producer] Connected to broker at ‹10.154.0.9:9092› (registered as esl/betmeta#1)
I210506 21:26:48.148633 87004822 vendor/github.com/Shopify/sarama/async_producer.go:959 ⋮ [kafka-producer] producer/broker/1 state change to [closing] because ‹EOF›
I210506 21:26:48.148727 87004822 vendor/github.com/Shopify/sarama/broker.go:252 ⋮ [kafka-producer] Closed connection to broker ‹10.154.0.9:9092›
I210506 21:26:48.148771 87004820 vendor/github.com/Shopify/sarama/async_producer.go:579 ⋮ [kafka-producer] producer/leader/‹names›/0 state change to [retrying-1]
I210506 21:26:48.148798 87004820 vendor/github.com/Shopify/sarama/async_producer.go:589 ⋮ [kafka-producer] producer/leader/‹names›/0 abandoning broker 1
I210506 21:26:48.148810 87004822 vendor/github.com/Shopify/sarama/async_producer.go:789 ⋮ [kafka-producer] producer/broker/1 shut down
I210506 21:26:48.248983 87004820 vendor/github.com/Shopify/sarama/client.go:772 ⋮ [kafka-producer] client/metadata fetching metadata for ‹[names]› from broker ‹10.154.0.7:9092›
I210506 21:26:48.249621 87004826 vendor/github.com/Shopify/sarama/async_producer.go:710 ⋮ [kafka-producer] producer/broker/1 starting up
I210506 21:26:48.249677 87004826 vendor/github.com/Shopify/sarama/async_producer.go:721 ⋮ [kafka-producer] producer/broker/1 state change to [open] on ‹names›/0
I210506 21:26:48.249704 87004820 vendor/github.com/Shopify/sarama/async_producer.go:571 ⋮ [kafka-producer] producer/leader/‹names›/0 selected broker 1
I210506 21:26:48.249781 87004820 vendor/github.com/Shopify/sarama/async_producer.go:595 ⋮ [kafka-producer] producer/leader/‹names›/0 state change to [flushing-1]
I210506 21:26:48.249808 87004820 vendor/github.com/Shopify/sarama/async_producer.go:617 ⋮ [kafka-producer] producer/leader/‹names›/0 state change to [normal]
I210506 21:26:48.250071 87004825 vendor/github.com/Shopify/sarama/broker.go:211 ⋮ [kafka-producer] Connected to broker at ‹10.154.0.9:9092› (registered as esl/betmeta#1)
I210506 21:26:48.250448 87004826 vendor/github.com/Shopify/sarama/async_producer.go:959 ⋮ [kafka-producer] producer/broker/1 state change to [closing] because ‹EOF›
I210506 21:26:48.250538 87004826 vendor/github.com/Shopify/sarama/broker.go:252 ⋮ [kafka-producer] Closed connection to broker ‹10.154.0.9:9092›
I210506 21:26:48.250563 87004820 vendor/github.com/Shopify/sarama/async_producer.go:579 ⋮ [kafka-producer] producer/leader/‹names›/0 state change to [retrying-2]
I210506 21:26:48.250611 87004820 vendor/github.com/Shopify/sarama/async_producer.go:589 ⋮ [kafka-producer] producer/leader/‹names›/0 abandoning broker 1
I210506 21:26:48.250630 87004826 vendor/github.com/Shopify/sarama/async_producer.go:789 ⋮ [kafka-producer] producer/broker/1 shut down
I210506 21:26:48.350767 87004820 vendor/github.com/Shopify/sarama/client.go:772 ⋮ [kafka-producer] client/metadata fetching metadata for ‹[names]› from broker ‹10.154.0.7:9092›
I210506 21:26:48.351346 87004806 vendor/github.com/Shopify/sarama/async_producer.go:710 ⋮ [kafka-producer] producer/broker/1 starting up
I210506 21:26:48.351391 87004806 vendor/github.com/Shopify/sarama/async_producer.go:721 ⋮ [kafka-producer] producer/broker/1 state change to [open] on ‹names›/0
I210506 21:26:48.351408 87004820 vendor/github.com/Shopify/sarama/async_producer.go:571 ⋮ [kafka-producer] producer/leader/‹names›/0 selected broker 1
I210506 21:26:48.351494 87004820 vendor/github.com/Shopify/sarama/async_producer.go:595 ⋮ [kafka-producer] producer/leader/‹names›/0 state change to [flushing-2]
I210506 21:26:48.351507 87004820 vendor/github.com/Shopify/sarama/async_producer.go:617 ⋮ [kafka-producer] producer/leader/‹names›/0 state change to [normal]
I210506 21:26:48.351617 87004805 vendor/github.com/Shopify/sarama/broker.go:211 ⋮ [kafka-producer] Connected to broker at ‹10.154.0.9:9092› (registered as esl/betmeta#1)
I210506 21:26:48.352011 87004806 vendor/github.com/Shopify/sarama/async_producer.go:959 ⋮ [kafka-producer] producer/broker/1 state change to [closing] because ‹EOF›
I210506 21:26:48.352085 87004806 vendor/github.com/Shopify/sarama/broker.go:252 ⋮ [kafka-producer] Closed connection to broker ‹10.154.0.9:9092›
I210506 21:26:48.352143 87004820 vendor/github.com/Shopify/sarama/async_producer.go:579 ⋮ [kafka-producer] producer/leader/‹names›/0 state change to [retrying-3]
I210506 21:26:48.352152 87004820 vendor/github.com/Shopify/sarama/async_producer.go:589 ⋮ [kafka-producer] producer/leader/‹names›/0 abandoning broker 1
I210506 21:26:48.352177 87004806 vendor/github.com/Shopify/sarama/async_producer.go:789 ⋮ [kafka-producer] producer/broker/1 shut down
I210506 21:26:48.452331 87004820 vendor/github.com/Shopify/sarama/client.go:772 ⋮ [kafka-producer] client/metadata fetching metadata for ‹[names]› from broker ‹10.154.0.7:9092›
I210506 21:26:48.452945 87004810 vendor/github.com/Shopify/sarama/async_producer.go:710 ⋮ [kafka-producer] producer/broker/1 starting up
I210506 21:26:48.453005 87004810 vendor/github.com/Shopify/sarama/async_producer.go:721 ⋮ [kafka-producer] producer/broker/1 state change to [open] on ‹names›/0
I210506 21:26:48.453031 87004820 vendor/github.com/Shopify/sarama/async_producer.go:571 ⋮ [kafka-producer] producer/leader/‹names›/0 selected broker 1
I210506 21:26:48.453098 87004820 vendor/github.com/Shopify/sarama/async_producer.go:595 ⋮ [kafka-producer] producer/leader/‹names›/0 state change to [flushing-3]
I210506 21:26:48.453110 87004820 vendor/github.com/Shopify/sarama/async_producer.go:617 ⋮ [kafka-producer] producer/leader/‹names›/0 state change to [normal]
I210506 21:26:48.453384 87004809 vendor/github.com/Shopify/sarama/broker.go:211 ⋮ [kafka-producer] Connected to broker at ‹10.154.0.9:9092› (registered as esl/betmeta#1)
I210506 21:26:48.453858 87004810 vendor/github.com/Shopify/sarama/async_producer.go:959 ⋮ [kafka-producer] producer/broker/1 state change to [closing] because ‹EOF›
I210506 21:26:48.453948 87004810 vendor/github.com/Shopify/sarama/broker.go:252 ⋮ [kafka-producer] Closed connection to broker ‹10.154.0.9:9092›
I210506 21:26:48.454119 87004785 vendor/github.com/Shopify/sarama/async_producer.go:1003 ⋮ [kafka-producer] ‹Producer shutting down.›
I210506 21:26:48.454154 87004810 vendor/github.com/Shopify/sarama/async_producer.go:789 ⋮ [kafka-producer] producer/broker/1 shut down
I210506 21:26:48.454171 86945049 vendor/github.com/Shopify/sarama/client.go:227 ⋮ [kafka-producer] ‹Closing Client›
I210506 21:26:48.454251 87004839 vendor/github.com/Shopify/sarama/broker.go:252 ⋮ [kafka-producer] Closed connection to broker ‹10.154.0.7:9092›
I210506 21:26:48.454294 87004840 vendor/github.com/Shopify/sarama/async_producer.go:1003 ⋮ [kafka-producer] ‹Producer shutting down.›
I210506 21:26:48.454317 86945049 vendor/github.com/Shopify/sarama/client.go:227 ⋮ [kafka-producer] ‹Closing Client›
W210506 21:26:48.454343 86945049 ccl/changefeedccl/changefeed_stmt.go:619 ⋮ [n1,job=656224550401802241] CHANGEFEED job 656224550401802241 encountered retryable error: ‹retryable changefeed error›: ‹kafka: Failed to produce message to topic names: EOF›
I210506 21:26:48.454826 87004846 vendor/github.com/Shopify/sarama/broker.go:252 ⋮ [kafka-producer] Closed connection to broker ‹10.154.0.7:9092›
@ghost ghost added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label May 6, 2021
@blathers-crl
Copy link

blathers-crl bot commented May 6, 2021

Hello, I am Blathers. I am here to help you get the issue triaged.

It looks like you have not filled out the issue in the format of any of our templates. To best assist you, we advise you to use one of these templates.

I have CC'd a few people who may be able to assist you:

  • @cockroachdb/cdc (found keywords: changefeed,changefeedccl,kafka)

If we have not gotten back to your issue within a few business days, you can try the following:

  • Join our community slack channel and ask on #cockroachdb.
  • Try find someone from here if you know they worked closely on the area and CC them.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@blathers-crl blathers-crl bot added O-community Originated from the community X-blathers-triaged blathers was able to find an owner labels May 6, 2021
@stevendanna
Copy link
Collaborator

stevendanna commented May 7, 2021

I am able to produce the same error using CRDB v20.2.8 and redpanda v21.5.1. The same test on v21.1.0-rc.1 works as expected. It looks like the upgrade in facbd60 potentially resolved the underlying issue.

Reproduction steps
SET CLUSTER SETTING cluster.organization = 'Cockroach Labs - Production Testing'; 
SET CLUSTER SETTING enterprise.license = 'REDACTED';
SET CLUSTER SETTING kv.rangefeed.enabled = true;
CREATE TABLE test (pk INT PRIMARY KEY, animal VARCHAR);
CREATE CHANGEFEED FOR TABLE test INTO 'kafka://127.0.0.1:50963';
INSERT INTO test VALUES (1, 'ardvark');
Stacktrace from logs matching reported failure
I210507 09:42:20.827508 3906 vendor/github.com/Shopify/sarama/client.go:772 ⋮ [kafka-producer] client/metadata fetching metadata for ‹[test]› from broker ‹127.0.0.1:50963›
I210507 09:42:20.829826 3923 vendor/github.com/Shopify/sarama/async_producer.go:710 ⋮ [kafka-producer] producer/broker/0 starting up
I210507 09:42:20.829917 3923 vendor/github.com/Shopify/sarama/async_producer.go:721 ⋮ [kafka-producer] producer/broker/0 state change to [open] on ‹test›/0
I210507 09:42:20.829937 3906 vendor/github.com/Shopify/sarama/async_producer.go:571 ⋮ [kafka-producer] producer/leader/‹test›/0 selected broker 0
I210507 09:42:20.829998 3906 vendor/github.com/Shopify/sarama/async_producer.go:595 ⋮ [kafka-producer] producer/leader/‹test›/0 state change to [flushing-3]
I210507 09:42:20.830037 3906 vendor/github.com/Shopify/sarama/async_producer.go:617 ⋮ [kafka-producer] producer/leader/‹test›/0 state change to [normal]
I210507 09:42:20.830079 3922 vendor/github.com/Shopify/sarama/broker.go:211 ⋮ [kafka-producer] Connected to broker at ‹127.0.0.1:50963› (registered as #0)
I210507 09:42:20.831915 3923 vendor/github.com/Shopify/sarama/async_producer.go:959 ⋮ [kafka-producer] producer/broker/0 state change to [closing] because ‹EOF›
I210507 09:42:20.832019 3923 vendor/github.com/Shopify/sarama/broker.go:252 ⋮ [kafka-producer] Closed connection to broker ‹127.0.0.1:50963›
I210507 09:42:20.832134 3900 vendor/github.com/Shopify/sarama/async_producer.go:1003 ⋮ [kafka-producer] ‹Producer shutting down.›
I210507 09:42:20.832196 3923 vendor/github.com/Shopify/sarama/async_producer.go:789 ⋮ [kafka-producer] producer/broker/0 shut down
I210507 09:42:20.832216 2974 vendor/github.com/Shopify/sarama/client.go:227 ⋮ [kafka-producer] ‹Closing Client›
I210507 09:42:20.832281 3913 vendor/github.com/Shopify/sarama/async_producer.go:1003 ⋮ [kafka-producer] ‹Producer shutting down.›
I210507 09:42:20.832326 2974 vendor/github.com/Shopify/sarama/client.go:227 ⋮ [kafka-producer] ‹Closing Client›
I210507 09:42:20.832302 3912 vendor/github.com/Shopify/sarama/broker.go:252 ⋮ [kafka-producer] Closed connection to broker ‹127.0.0.1:50963›
W210507 09:42:20.832367 2974 ccl/changefeedccl/changefeed_stmt.go:620 ⋮ [n1,job=656376196663443457] CHANGEFEED job 656376196663443457 encountered retryable error: ‹retryable changefeed error›: ‹EOF›

NB: It looks like in redpanda-data/redpanda#898 redpanda itself upgrade to a newer version of Sarama specifically to pull in IBM/sarama#1898. We haven't yet pulled in that fix; although it isn't clear to me that it is relevant here.

@ghost
Copy link
Author

ghost commented May 7, 2021

Excellent - we want to use 21 anyway. I'll see what it takes to upgrade our environment.

Yep, sarami 1.29.0 has no issues talking to redpanda rpk version v21.5.1 (rev 47c6e63)

[b@cockroach-1 ~]$ rpk topic create integrate
Created topic 'integrate'.
You may check its config with

rpk topic describe 'integrate'
yum -y install golang
go get github.com/Shopify/sarama/tools/kafka-console-producer

go: downloading github.com/Shopify/sarama v1.29.0

[root@cockroach-1 ~]# go/bin/kafka-console-producer -verbose -brokers 10.0.154.7:9092,10.154.0.9:9092,10.154.0.11:9092  -topic integrate -value test
2021/05/07 15:02:15 Initializing new client
2021/05/07 15:02:15 ClientID is the default of 'sarama', you should consider setting it to something application-specific.
2021/05/07 15:02:15 ClientID is the default of 'sarama', you should consider setting it to something application-specific.
2021/05/07 15:02:15 client/metadata fetching metadata for all topics from broker 10.154.0.11:9092
2021/05/07 15:02:15 Connected to broker at 10.154.0.11:9092 (unregistered)
2021/05/07 15:02:15 client/brokers registered new broker #3 at 10.154.0.25:9092
2021/05/07 15:02:15 client/brokers registered new broker #1 at 10.154.0.9:9092
2021/05/07 15:02:15 client/brokers registered new broker #2 at 10.154.0.11:9092
2021/05/07 15:02:15 client/brokers registered new broker #0 at 10.154.0.7:9092
2021/05/07 15:02:15 Successfully initialized new client
2021/05/07 15:02:15 ClientID is the default of 'sarama', you should consider setting it to something application-specific.
2021/05/07 15:02:15 producer/broker/1 starting up
2021/05/07 15:02:15 producer/broker/1 state change to [open] on integrate/0
2021/05/07 15:02:15 Connected to broker at 10.154.0.9:9092 (registered as #1)
topic=integrate partition=0     offset=0
2021/05/07 15:02:15 Producer shutting down.
2021/05/07 15:02:15 Closing Client
2021/05/07 15:02:15 Closed connection to broker 10.154.0.11:9092
[b@cockroach-1 ~]$ rpk topic consume integrate 
{
 "message": "test",
 "partition": 0,
 "offset": 0,
 "timestamp": "2021-05-07T15:02:15.033Z"
}

So that's working...

@emaxerrno
Copy link

@stevendanna good notes.

change IBM/sarama#1898 from sarama shouldn't be needed anymore starting redpanda v21.5.1 - we now return the exact same offsets (even if we were always protocol-correct). The change in redpanda redpanda-data/redpanda#898 was really about pulling in the 1898 from sarama. this is again no longer needed.

I'm happy to help debug. but not sure how crdb gets to

W210506 21:26:48.454343 86945049 ccl/changefeedccl/changefeed_stmt.go:619 ⋮ [n1,job=656224550401802241] CHANGEFEED job 656224550401802241 encountered retryable error: ‹retryable changefeed error›: ‹kafka: Failed to produce message to topic names: EOF›

Are topics relying on autocreate by chance? curious.

@emaxerrno
Copy link

looks like a pretty long list of fixes in the sarama, so could be anything trivial to sarama not parsing a setting - https://github.com/Shopify/sarama/compare/v1.22.1..v1.27.1

@stevendanna
Copy link
Collaborator


Excellent - we want to use 21 anyway. I'll see what it takes to upgrade our environment.

👍 I'll likely still look at whether the sarama upgrade is backportable to 20.2.


change IBM/sarama#1898 from sarama shouldn't be needed anymore starting redpanda v21.5.1 - we now return the exact same offsets (even if we were always protocol-correct). The change in redpanda redpanda-data/redpanda#898 was really about pulling in the 1898 from sarama. this is again no longer needed.

Cool. That's good to know, thanks!

Are topics relying on autocreate by chance? curious.

Yes, we auto-create topics based on the table name if the topic does not already already exist.

looks like a pretty long list of fixes in the sarama, so could be anything trivial to sarama not parsing a setting - https://github.com/Shopify/sarama/compare/v1.22.1..v1.27.1

I would not be surprised if there were multiple fixes in there that are important. I believe that the upgrade was motivated by similar incompatibilities with some other kafka-speaking services.

@ghost
Copy link
Author

ghost commented May 10, 2021

Confirm upgrade to cockroach-v21.1.0-rc.1.linux-amd64 fixes the issue.

👍 I'll likely still look at whether the sarama upgrade is backportable to 20.2.

_That would be very helpful ^ _

Quick-n-dirty upgrayedd script..

alias cp=cp
systemctl stop cockroachdb
export cockroach_download_version=cockroach-v21.1.0-rc.1.linux-amd64
echo install cockroach
wget -qO- https://binaries.cockroachdb.com/${cockroach_download_version}.tgz | tar xvz
cp -f ${cockroach_download_version}/cockroach /usr/local/bin/
mkdir -p /usr/local/lib/cockroach
cp -f ${cockroach_download_version}/lib/libgeos.so /usr/local/lib/cockroach/
cp -f ${cockroach_download_version}/lib/libgeos_c.so /usr/local/lib/cockroach/
systemctl start cockroachdb

Puts all the existing table entries to topic ( rpk topic consume names)

Screenshot 2021-05-10 at 12 03 30

@stevendanna
Copy link
Collaborator

_That would be very helpful ^ _

Just to avoid any bad expectation setting: Since it is a dependency update that will pull in more than just that single library, I'm not sure it'll make sense to backport it.

@rkruze
Copy link

rkruze commented May 10, 2021

After looking at this, it seems that Cockroach is using a pretty old producer API. This is what I'm seeing from the logs in Redpanda: kafka - connection_context.cc:141 - Detected error processing request: std::runtime_error (Unsupported version 0 for produce API)

@rkruze
Copy link

rkruze commented May 10, 2021

I took a look at the Cockroach CDC implementation, and it looks like they don't set the Kafka version so it defaults to version 1.0 of Kafka. It should just work if they specify the version to 2.4.0 or higher.

Here is an example from the Sarama example code: https://github.com/Shopify/sarama/blob/83d633e6e4f71b402df5e9c53ad5c1c334b7065d/examples/consumergroup/main.go#L57

@rkruze
Copy link

rkruze commented May 10, 2021

Ok, my mistake, so with the version of Sarama that Cockroach is currently using, it defaults to the minimum version, which is V0_8_2_0, in the later version of Sarama it defaults to version V1_0_0_0. So even setting the version to V1_0_0_0 should just make it work with Redpanda.

https://github.com/Shopify/sarama/pull/1791/files#diff-0e426a43248661127a0c0ee115aef7a1093b635f8993b3f7ebb1dd9f05b8f249L489

rkruze added a commit to rkruze/cockroach that referenced this issue May 11, 2021
Previously the Kafka sink didn't specify a version to sarama, so it
defaulted to the minimum version of 0.8.2. This behavior has been
changed in the latest version of sarama to use version 1.0 of the
Kafka API. Information on why this change was made by sarama can be
found here:
IBM/sarama#1787

Resolves cockroachdb#64842

Release note (enterprise change): Set the Kafka CDC sink to use the 1.0
version of the Kafka API.
@stevendanna
Copy link
Collaborator

@rkruze Thanks for taking a look!

@emaxerrno
Copy link

All - we also patched redpanda to parse v0 of the produce - redpanda-data/redpanda#1389

(prolly out on redpanda v21.5.3)

@stevendanna
Copy link
Collaborator

@senior7515 Nice, thanks!

@stevendanna
Copy link
Collaborator

I'm going to close this for now. In addition to the changes to redpanda, in CRDB,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-community Originated from the community X-blathers-triaged blathers was able to find an owner
Projects
None yet
Development

No branches or pull requests

3 participants