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: add kafka sink config options for idempotence, retries, and max.inflight.requests.per.connection #122326

Closed
3 tasks
andyyang890 opened this issue Apr 13, 2024 · 3 comments
Assignees
Labels
A-cdc Change Data Capture C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-support Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs T-cdc

Comments

@andyyang890
Copy link
Collaborator

andyyang890 commented Apr 13, 2024

We should allow users to customize the following Kafka producer options (corresponding sarama options in brackets) as they have an impact on whether events may become not strictly ordered after retries:

  • enable.idempotence (Producer.Idempotent)
  • retries (Producer.Retry.Max)
  • max.in.flight.requests.per.connection (Net.MaxOpenRequests)

Namely, the sarama defaults for these options (enable.idempotence = false, retries = 50, max.in.flight.requests.per.connection = 5), which we use, could potentially allow events to become not strictly ordered during retries.

From the Kafka documentation about retries (https://kafka.apache.org/documentation/#producerconfigs_retries):

Allowing retries while setting enable.idempotence to false and max.in.flight.requests.per.connection to greater than 1 will potentially change the ordering of records because if two batches are sent to a single partition, and the first fails and is retried but the second succeeds, then the records in the second batch may appear first.

Jira issue: CRDB-37801

@andyyang890 andyyang890 added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-cdc Change Data Capture T-cdc labels Apr 13, 2024
Copy link

blathers-crl bot commented Apr 13, 2024

cc @cockroachdb/cdc

@andyyang890 andyyang890 added the O-support Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs label Apr 13, 2024
@andyyang890
Copy link
Collaborator Author

I investigated this a bit and it seems like for the version of sarama we're on (v1.42.1), this still leads to out-of-order issues. Based on IBM/sarama#2803, it seems like this is a bug in newer versions of sarama. We could consider downgrading sarama or switching off of the AsyncProducer.

@rharding6373
Copy link
Collaborator

Since exposing these options won't fix the underlying out of order issue, we are not going to be implementing this in the foreseeable future. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cdc Change Data Capture C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-support Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs T-cdc
Projects
None yet
Development

No branches or pull requests

2 participants