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

Bugfixes #99

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Bugfixes #99

wants to merge 2 commits into from

Conversation

Bouncheck
Copy link
Collaborator

One bugfix for config parsing and one additional logging.

Currently if any config option starts with `topic.` prefix,
the connector will attempt to match it against regular expression
for TopicWiseConfigs. If it fails then whole connector fails to start.
This is a problem when launching on Confluent Cloud which adds
for example `topic.creation.default.max.message.bytes` config.

It mistakenly gets through the first check because it starts with `topic.`
and then trips up on regular expression. It seems there could be many more
configs like this that pertain to Kafka topic but are not this connectors
TopicWiseConfigs.

Adding suffix check should be sufficient and it should not break existing
configurations as long as those adhered to the existing documentation.
If user sets connector up in schemaless mode and forgets
to create the table, the connector tasks will fail with NullPointerException.
Added warning should make it more obvious as to what is the issue.

I am not adding throw here just in case there exists a situation
where table creation could lag behind. Connector should continue
working normally after the table is created.
@Bouncheck Bouncheck self-assigned this Jul 27, 2024
@dkropachev
Copy link
Collaborator

@Bouncheck , could you please specify what bug does it fix

@Bouncheck
Copy link
Collaborator Author

The bug is collision between config names. We have our own pattern for extra configs which wrongly matches some more general configs added by some Kafka platforms. There is more details inside commit message.

@@ -62,6 +64,10 @@ public class ScyllaDbSinkConnectorConfig extends AbstractConfig {
private static final Pattern TOPIC_KS_TABLE_SETTING_PATTERN =
Pattern.compile("topic\\.([a-zA-Z0-9._-]+)\\.([^.]+|\"[\"]+\")\\.([^.]+|\"[\"]+\")\\.(mapping|consistencyLevel|ttlSeconds|deletesEnabled)$");

private static final String[] TOPIC_WISE_CONFIGS_VALID_SUFFIXES = {".mapping",".consistencyLevel",".ttlSeconds",".deletesEnabled"};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please add some comments that briefly explains what this const is

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

Successfully merging this pull request may close these issues.

2 participants