DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
This page is meant as a template for writing a KIP. To create a KIP choose Tools->Copy on this page and modify with your content and replace the heading with the next KIP number and a description of your issue. Replace anything in italics with your own description.
Status
Current state: Under Discussion
Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]
JIRA: [KAFKA-19883](
KAFKA-19883
-
Getting issue details...
STATUS
)
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Motivation
Share Groups currently support only immediate acknowledgement modes (IMPLICIT/EXPLICIT). This causes **data loss** in distributed streaming frameworks:
1. Worker acknowledges records → Records removed from Kafka
2. Checkpoint fails before sink write
3. Records lost (acknowledged but never persisted)
**Goal:** Enable exactly-once read semantics via transactional acknowledgements.
### Use Cases
- **Apache Flink:** Exactly-once checkpointing with Share Group sources
- **Apache Spark:** Structured Streaming with Share Group consumers
- **Any coordinator-worker streaming framework** requiring atomic acknowledgements
Public Interfaces
### New Consumer API Methods
```java
public interface ShareConsumer<K, V> {
// Existing
void acknowledge(ConsumerRecord<K, V> record, AcknowledgeType type);
// New: Transactional acknowledgement
void acknowledge(ConsumerRecord<K, V> record, AcknowledgeType type,
String transactionId);
}
```
### New Coordinator API
```java
public interface ShareTransactionCoordinator {
void beginTransaction(String transactionId, Duration timeout);
void prepareTransaction(String transactionId) throws TransactionPrepareException;
void commitTransaction(String transactionId) throws TransactionCommitException;
void abortTransaction(String transactionId);
List<PendingTransaction> listPendingTransactions(String groupId);
}
```
New Configuration
Config Default Description
share.acknowledgement.mode explicit Values: implicit, explicit, transactional
share.transaction.timeout.ms 60000 Maximum transaction duration before auto-abort
share.transaction.max.pending 5 Maximum concurrent transactions per group
New Wire Protocol Requests
Request Description
ShareAcknowledgeTransactional Acknowledge records within a transaction
ShareBeginTransaction Start a new batch transaction
SharePrepareTransaction Phase 1: Prepare transaction
ShareCommitTransaction Phase 2: Commit transaction
ShareAbortTransaction Abort transaction and release records
New Metrics
Metric Type Description
share-transaction-active Gauge Active transactions
share-transaction-prepare-time-ms Histogram Prepare latency
share-transaction-commit-time-ms Histogram Commit latency
share-transaction-abort-total Counter Aborted transactions
share-transaction-timeout-total Counter Timed-out transactions
Proposed Changes
Describe the new thing you want to do in appropriate detail. This may be fairly extensive and have large subsections of its own. Or it may be a few sentences. Use judgement based on the scope of the change.
Compatibility, Deprecation, and Migration Plan
- What impact (if any) will there be on existing users?
- If we are changing behavior how will we phase out the older behavior?
- If we need special migration tools, describe them here.
- When will we remove the existing behavior?
Test Plan
Describe in few sentences how the KIP will be tested. We are mostly interested in system tests (since unit-tests are specific to implementation details). How will we know that the implementation works as expected? How will we know nothing broke?
Rejected Alternatives
If there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.