Skip to content

KIP-679: Update Producer defaults => enable_idempotence=True, acks='all'#3013

Merged
dpkp merged 2 commits into
masterfrom
claude/KIP-679
May 28, 2026
Merged

KIP-679: Update Producer defaults => enable_idempotence=True, acks='all'#3013
dpkp merged 2 commits into
masterfrom
claude/KIP-679

Conversation

@dpkp
Copy link
Copy Markdown
Owner

@dpkp dpkp commented May 28, 2026

  • KIP-679: Refactor idempotence config resolution
  • KIP-679: Enable strongest delivery guarantees by default

dpkp added 2 commits May 28, 2026 06:27
Replace the strict-fail check in KafkaProducer.__init__ with the Java
client's KIP-679 resolution: when idempotence is on but the user has
explicitly set a conflicting acks/retries/max_in_flight_requests, the
client silently disables idempotence and logs a warning. Conflicts only
raise when the user explicitly opted into idempotence (or set
transactional_id, which forces strict mode).

Broker version handling moves from an assert to a KafkaConfigurationError
on explicit idempotence, or a warning + silent disable when idempotence
came from defaults. acks remains user-specified (or -1) regardless of
fallback.

This commit only changes the resolution logic. The defaults
(enable_idempotence=False, acks=1) are unchanged; flipping them is a
follow-up. test/producer/test_kip679_config.py covers the explicit and
transactional-strict paths; test_sender.py's existing max-in-flight
rejection test is updated to match the new error message.
Flip KafkaProducer's DEFAULT_CONFIG to match Java's KIP-679 defaults:
  enable_idempotence: False -> True
  acks: 1 -> -1 ('all')

With the resolution machinery from the prior commit, users who pass a
conflicting acks/retries/max_in_flight without touching enable_idempotence
silently get the old non-idempotent behavior plus a warning log; users
who explicitly opt in to idempotence still get a hard error on conflicts.
Against pre-0.11 brokers, default-on idempotence is silently disabled
while acks=-1 is preserved (acks=all is valid on any wire version).

Docstrings updated. Three tests in test/producer/test_producer.py that
constructed KafkaProducer() with implicit defaults now pin
enable_idempotence=False since they target thread-shutdown/send-path
behavior, not idempotence. New silent-disable, opt-out, and old-broker
test cases added to test/producer/test_kip679_config.py.
@dpkp dpkp merged commit 7417a5d into master May 28, 2026
19 checks passed
@dpkp dpkp deleted the claude/KIP-679 branch May 28, 2026 13:39
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.

1 participant