Repository navigation
Return a reference from MergeTreeReaderWide::getOrAddStream - #123810
PedroTadim merged 1 commit into
Conversation
`FileStreams::getOrCreate` returns either the existing map entry or the one it just inserted, and the only factory (`getOrAddStream`'s lambda) always returns `std::make_unique` (throws on failure, never null); `release` moves the entry out and erases it under the same lock, so the map never holds a null stream. Every caller either dereferenced the pointer unchecked or discarded it, so return `MergeTreeReaderStream &` from both functions instead. `FileStreams::find` stays a pointer because it returns null for a missing stream, and `getAll` stays a vector of pointers. Follow-up to ClickHouse#123160, requested in ClickHouse#123160 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review (click to expand): 0 blockers, 0 majors, 1 nit
My own cold review of the diff and a second Gate B run on the corrected description: no findings. |
|
Workflow [PR], commit [7a6a16e] Summary: ❌
AI ReviewSummaryThis PR tightens Final Verdict
LLVM Coverage ReportMeasured on commit 7a6a16e.
Changed lines: Changed C/C++ lines covered: 28/28 (100.00%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units8 translation units recompiled, 21 s compile time in total, 8 of them have a recent master baseline. |
CI finish ledger - 7a6a16eEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
All 149 check runs completed, Session id: cron:our-pr-ci-monitor:20261004-090143 |
|
Fixing PR for the Stateless tests (arm_asan_ubsan, azure, sequential) job timeout: #123849. |
915744a
Related: #123160
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Description
Follow-up to #123160, as requested in #123160 (comment): a pointer that cannot be null should be a reference.
FileStreams::getOrCreatereturns either the existing map entry or the one it has just inserted, and the only factory (the lambda ingetOrAddStream) returnsstd::make_unique, so neither function can return null. Both now returnMergeTreeReaderStream &, and the three callers that use the result takeauto &.FileStreams::findstays a pointer, because it returns null for a missing stream.No behaviour change. Checked with a debug build and 672
bucket|dynamic|subcolumn|low_cardinalitystateless tests with randomized settings, run against binaries with and without the change: the results are identical.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/123810]
Version info
26.10.1.1562-master(included in26.10and later)