Repository navigation
Add write buffer adaptor to Stream the UNIQUE KEY index SST directly into part storage - #111189
Conversation
|
@murphy-4o hi, I hope to use an adapter to write RocksDB SST data directly into ClickHouse's |
|
Workflow [PR], commit [f60bb35] Summary: ✅
AI ReviewSummaryThis PR replaces the local-temp-file SST staging flow with a custom RocksDB write adapter that streams Findings
Final VerdictChanges are close, but I would not approve as-is because |
9ad228b to
2cdbe56
Compare
2cdbe56 to
e72f957
Compare
a9dc488 to
0233dbc
Compare
46de89b to
b604cf6
Compare
optimize comment optimize code # Conflicts: # src/Common/ProfileEvents.cpp # src/Storages/MergeTree/UniqueKey/SSTIndexWriter.cpp # src/Storages/MergeTree/UniqueKey/tests/gtest_unique_key_sst_probe.cpp
797d058 to
f60bb35
Compare
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 129/162 (79.63%) · Uncovered code |
8aad759
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Write the UNIQUE KEY index SST directly into the part through the storage abstraction, instead of staging it in a local temporary file.
Motivation
The per-part UNIQUE KEY index SST (
unique_key_index.sst) is built by RocksDB'sSstFileWriter, which needs a real local path. The old code staged it on the context's temporary volume and copied it into the part via a.tmp+replaceFiledance. That hard-depended on a local temporary volume (a remotetmp_policydisk was rejected outright, blocking object-storage deployments) and wrote the bytes twice.Approach
RocksDB now writes through a custom
rocksdb::Envthat forwards its bytes straight into the part storage'sWriteBuffer, the same path used forcolumn.bin, marks, and the primary index. On the write path this works for local disks and transactional part builds without any local staging or replaceFile. The SST bytes are streamed straight into the part storage WriteBuffer, the same path used for column.bin, marks, and the primary index.TODO: the read path (ensureValidDenseIndex and the SST probe) still opens unique_key_index.sst via storage.getFullPath() + RocksDB's SstFileReader::Open, which requires a local filesystem path. Lifting the reader onto the IDataPartStorage abstraction (or materializing the SST locally before open) will be addressed in a follow-up PR.
Version info
26.8.1.498(included in26.8and later)