Commit 679ce7f
Fix intermittent IllegalGeneration error in spk publish
spk publish's listen_to_index_status_updates() subscribed to the
index-updates topic via Kafka consumer-group management and then
immediately committed starting offsets, before the consumer had
joined the group / finished rebalancing (the join only happens on
the first poll). Committing offsets with no valid group generation
intermittently failed with:
failed to commit new starting offsets for the kafka index
updates consumer: Consumer commit error: IllegalGeneration
(Broker: Specified group generation id is not valid)
The commit served no purpose anyway: this consumer uses a fresh,
ephemeral Ulid group id every run, so the committed offsets are
never read back.
Switch this read-only consumer from subscribe() + commit() to
manual partition assignment (assign()) with the starting offsets
carried in the TopicPartitionList. Manual assignment has no group
generation, so the race cannot occur. The subscribe() call is
removed since a consumer cannot mix subscribe and assign.
The indexer's long-lived consumer is untouched; it legitimately
uses a stable group id and offset commits.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 8dac536 commit 679ce7f
2 files changed
Lines changed: 24 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
217 | 226 | | |
218 | 227 | | |
219 | 228 | | |
| |||
258 | 267 | | |
259 | 268 | | |
260 | 269 | | |
261 | | - | |
262 | | - | |
263 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
264 | 279 | | |
265 | | - | |
| 280 | + | |
266 | 281 | | |
267 | 282 | | |
268 | 283 | | |
| |||
324 | 339 | | |
325 | 340 | | |
326 | 341 | | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | 342 | | |
333 | | - | |
334 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
335 | 347 | | |
336 | 348 | | |
337 | 349 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
| 633 | + | |
633 | 634 | | |
634 | 635 | | |
635 | 636 | | |
| |||
0 commit comments