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

changefeedccl: allow user to configure kafka server version #65389

Merged

Conversation

stevendanna
Copy link
Collaborator

The upgrade to the sarama library in
facbd60 included a change to the
default Version assumed by sarama from 0.8.2.0 to 1.0.0.

The result of this is that we no longer support Kafka < 1.0 (Confluent
Platform < 4.0) out of the box.

All of the impacted versions are EOL according to:

https://docs.confluent.io/platform/current/installation/versions-interoperability.html

However, it may be nice to allow users still on those versions to
continue to use changefeeds.

While we could reduce the Version constant back to its original value,
that comes at the cost of potentially making the Kafka server do more
work to handle the older protocol messages.

This change allows the user to set the version via the
kafka_sink_config option. For example, users who need to connect to
Confluent 3 would use this new option like so:

CREATE CHANGEFEED FOR target_table INTO 'kafka://localhost:9092' WITH kafka_sink_config='{"version": "0.8.2.0"}';

Release note (enterprise): kafka_sink_config now supports a
version configuration item to specify Kafka server versions. This is
likely only necessary for old (Kafka 0.11/Confluent 3.3 or early)
Kafka servers. Further, unspecified items in kafka_sink_config now
retain their default values.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@stevendanna stevendanna requested review from miretskiy and HonoreDB May 18, 2021 13:28
@stevendanna
Copy link
Collaborator Author

Confluent provides docker containers with versions back to 3.0. It might be nice to have some nightly tests that uses those containers to test against a variety of versions.

@stevendanna stevendanna force-pushed the ssd/configurable-kafka-version branch from 09f3812 to 61e3c64 Compare May 18, 2021 13:32
Copy link
Contributor

@miretskiy miretskiy left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @HonoreDB and @stevendanna)


pkg/ccl/changefeedccl/sink_kafka.go, line 441 at r1 (raw file):

	*k = kafkaVersion(parsedVersion)
	return nil
}

You could probably drop this custom parsing struct if store Version as a plain string in saramaConfig and change Apply signature to return an error.

Copy link
Collaborator Author

@stevendanna stevendanna left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @HonoreDB and @miretskiy)


pkg/ccl/changefeedccl/sink_kafka.go, line 441 at r1 (raw file):

Previously, miretskiy (Yevgeniy Miretskiy) wrote…

You could probably drop this custom parsing struct if store Version as a plain string in saramaConfig and change Apply signature to return an error.

😆 I agree, that is what I originally had and then changed it to this when I saw the json parsing struct.

@stevendanna stevendanna force-pushed the ssd/configurable-kafka-version branch from 61e3c64 to 0709891 Compare May 19, 2021 08:42
The upgrade to the sarama library in
facbd60 included a change to the
default Version assumed by sarama from 0.8.2.0 to 1.0.0.

The result of this is that we no longer support Kafka < 1.0 (Confluent
Platform < 4.0) out of the box.

All of the impacted versions are EOL according to:

https://docs.confluent.io/platform/current/installation/versions-interoperability.html

However, it may be nice to allow users still on those versions to
continue to use changefeeds.

While we could reduce the Version constant back to its original value,
that comes at the cost of potentially making the Kafka server do more
work to handle the older protocol messages.

This change allows the user to set the version via the
kafka_sink_config option. For example, users who need to connect to
Confluent 3 would use this new option like so:

```
CREATE CHANGEFEED FOR target_table INTO 'kafka://localhost:9092' WITH kafka_sink_config='{"version": "0.8.2.0"}';
```

Release note (enterprise): `kafka_sink_config` now supports a
`version` configuration item to specify Kafka server versions. This is
likely only necessary for old (Kafka 0.11/Confluent 3.3 or early)
Kafka servers. Further, unspecified items in `kafka_sink_config` now
retain their default values.
@stevendanna
Copy link
Collaborator Author

bors r=miretskiy

@craig
Copy link
Contributor

craig bot commented May 25, 2021

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants