Commit 5e7c7c9
fix(inkless:consolidation): prevent ConsolidationFetcherThread crash on topic deletion (#627)
When a diskless topic is deleted, the ConsolidationFetcherThread crashes
permanently in buildFetch():
- localLogOrException() throws UnknownTopicOrPartitionException
- only KafkaStorageException is caught ? exception escapes doWork()
- ShutdownableThread exits with no recovery
This kills consolidation for ALL topics on the broker until restart.
The race: BrokerMetadataPublisher sets metadataCache.setImage(newImage)
(removing the topic from the cache) before applyDelta calls
stopPartitions (which removes the partition from the fetcher). In that
window, the fetcher's buildFetch reads a partition still in
partitionStates but gone from allPartitions/metadataCache.
The regular ReplicaFetcher never hits this because stopPartitions removes
from the fetcher BEFORE allPartitions.remove Ñ so the fetcher never sees
a partition that's been deleted from allPartitions. The consolidation
fetcher hits the window because metadata-view staleness creates a gap.
Fix: catch UnknownTopicOrPartitionException alongside KafkaStorageException
in DisklessLeaderEndPoint.buildFetch. The partition is added to
partitionsWithError, delayed, and evicted on the next cycle once
removePartitions completes.
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent f82bb06 commit 5e7c7c9
3 files changed
Lines changed: 30 additions & 2 deletions
File tree
- .github/workflows
- core/src
- main/scala/io/aiven/inkless/consolidation
- test/scala/io/aiven/inkless/consolidation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
176 | 177 | | |
| 178 | + | |
177 | 179 | | |
178 | 180 | | |
179 | 181 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
255 | 258 | | |
256 | 259 | | |
257 | 260 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
465 | 488 | | |
466 | 489 | | |
467 | 490 | | |
| |||
0 commit comments