Commit d7bea94
committed
Document the unanswered-commit case in transactional persistence
`KafkaSnapshotWriteDatabase.GroupCommit.commitBatch` aborts on every
failure. An adversarial review of the transactional mode reported that
this is a defect on one path - an ambiguous `commitTransaction` timeout,
where the broker may have committed anyway - and that the abort itself
leaves the producer unusable.
The first half is right; the second is not. kafka-clients throws
IllegalStateException from `abortTransaction` before any state transition
while a commit is unresolved, and `commitBatch` already discards that
throw via `voidError`. The abort is inert: what spends the producer is the
unacked commit itself, which the abort neither causes nor worsens. So
narrowing the abort to definitive failures would change no outcome.
Retrying the commit in place is the only change that would, and it is not
worth it - each attempt blocks up to a user-configured `max.block.ms`
inside the poll cycle, trading a loud failure for a possible silent
`max.poll.interval.ms` eviction. With the default
`ignorePersistErrors = false` the surfaced failure tears the module down,
and the next producer's `initTransactions` settles the transaction
broker-side.
No production change follows. What was missing is the documentation of the
case, and one pin:
- docs/persistence.md gains the failure that is not a rejection but an
unanswered commit: nothing local resolves it, nothing is lost (the input
offset rides the same transaction, so snapshot and offset commit
together or not at all), and `ignorePersistErrors = true` swallows it
too, leaving the partition frozen and self-consistent - not corrupted -
until the next rebalance.
- GroupCommitSpec pins that the commit surfaces as itself and is never
retried in place. That is the half a future edit could plausibly break,
and it needs no broker.
The client contract behind this is pinned as ext(K16) in the verification
research corpus, together with a broker-paused measurement: the abort
aborts nothing, the transaction still lands, and the producer refuses
every later transaction until rebuilt. That harness is deliberately not
checked in - it pins a kafka-clients contract rather than kafka-flow
behavior, and pauses the broker container to get there.1 parent 6f76364 commit d7bea94
2 files changed
Lines changed: 48 additions & 7 deletions
File tree
- docs
- persistence-kafka/src/test/scala/com/evolutiongaming/kafka/flow/kafkapersistence
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
66 | 76 | | |
67 | 77 | | |
68 | 78 | | |
| |||
Lines changed: 38 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
238 | 264 | | |
239 | 265 | | |
240 | 266 | | |
| |||
251 | 277 | | |
252 | 278 | | |
253 | 279 | | |
254 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
255 | 283 | | |
256 | 284 | | |
257 | 285 | | |
258 | | - | |
259 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
260 | 289 | | |
261 | 290 | | |
262 | 291 | | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
267 | 298 | | |
268 | 299 | | |
269 | 300 | | |
| |||
0 commit comments