perf(inkless:metadata): read topic type flags without copying the topic config #875
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.68) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.68 · 435 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.364
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.068
Real PR Conversation Timeline
1 comments
"Review active on #875"
general
weight: 0.35
giuseppelillo
InklessMetadataView.isDisklessTopicandisConsolidatingDisklessTopicrun for each partition on the produce, fetch, and leader-change paths. Each call copied every override of the topic into a newProperties, andisConsolidatingDisklessTopicmade two copies. The flags now read one key from a read-only view of the metadata image, so the cost no longer grows with the number of overrides.InklessMetadataViewTopicFlagBenchmarkmeasures one call on an image of 1000 topics. The additional overrides column doesn't count the two flag overrides that the diskless topics, half of the image, also have. Each cell shows the value before the change, then after it. Time is the JMH average per call. Allocation is the bytes allocated per call (-prof gc).| Method | Additional overrides | Time (ns) | Allocation (B) |
| ------------------------------ | -------------------- | ---------- | -------------- |
|
isDisklessTopic| 0 | 36 → 13 | 160 → 40 ||
isDisklessTopic| 10 | 174 → 16 | 640 → 24 ||
isDisklessTopic| 30 | 601 → 18 | 1816 → 24 ||
isConsolidatingDisklessTopic| 0 | 53 → 15 | 360 → 40 ||
isConsolidatingDisklessTopic| 10 | 278 → 18 | 1036 → 24 ||
isConsolidatingDisklessTopic| 30 | 881 → 19 | 2760 → 24 |The change also makes the diskless partition scans read one image. Before, if a new image deleted a topic during a scan, the scan threw
NoSuchElementExceptionto its caller: the retention scheduler or the consolidated log pruner.A flag value other than
trueorfalse, ignoring case, such as a paddedtruethat an alter can store, still throws, as onmain: no boolean reading of it is safe for both diskless and classic topics. The broker now also logs a warning when a topic config update has such a value.Commits
test(inkless:metadata): add JMH benchmark for topic type flag reads: addsInklessMetadataViewTopicFlagBenchmark. It needsjmh-benchmarksto depend on:storage:inkless.perf(inkless:metadata): read topic type flags without copying the topic config: changes the flag reads and the partition scans, and documents the contract in theMetadataViewJavadoc.See the commit messages for the reasoning behind each step.
Testing
InklessMetadataViewTestbuilds a realMetadataImagefor the flag tests instead of a stub oftopicConfig. It keeps thetrue,TRUE,false, empty, and unrelated-key cases.testTopicFlagsThrowOnValueThatIsNotBooleanchecks that a padded or non-boolean flag throws, andtestUpdateTopicConfigWarnsOnFlagThatIsNotBooleanchecks the warning.testTopicFlagsReadOneImageWithoutCopyingTopicConfigchecks that the flag methods never calltopicConfigand thatisConsolidatingDisklessTopicreads the image once.testGetDisklessTopicPartitionsReadOneImageForAllTopicschecks that a scan reads one image and doesn't make any other call on the cache.testGetConsolidatingDisklessTopicPartitionsListsTopicsFromImageNotFromConfigschecks that a config for a topic missing from the image doesn't give any partitions../jmh-benchmarks/jmh.sh -prof gc InklessMetadataViewTopicFlagBenchmarkon each commit. The benchmark commit gives the before column, and the perf commit gives the after column.