Repository navigation
Conversation
…ro_byte_data_file The fixture built its zero-byte data file from a column of countResample(10, 5, 1) states. That parameterisation covers an empty range, so every state serializes to nothing: the column deserializes to zero rows while __marks.mrk still records 100, LogSource::readData drops the empty column, and a chunk with fewer columns than its output port header reaches ISource::prepare(). Any read of the table this test leaves behind then aborts with "Invalid number of columns in chunk pushed to OutputPort. Expected 2, found 1" (issue ClickHouse#119727). The test reports OK itself, so the abort is attributed to whatever ran next, which is why it reds master and unrelated pull requests rather than 05211. Build the same on-disk condition from an all-empty Array(UInt64) column instead. Its element stream receives nothing, so s.bin holds 0 bytes beside a populated s.size0.bin, and reading it back does not go through the broken path: the array consistency check compares nested size against the last offset, and both are 0. This costs one of the two carriers the test covered. With an array column data_files[0] is the always-populated sizes stream, so reverting StorageLog::hasNothingToBackUp no longer reddens the test, while reverting BackupImpl::copyFileToDisk still does, on all three restored arms. Only an empty aggregate state can occupy zero bytes at index 0 while rows exist, and that is the construct being removed, so the new test 05212 rebuilds the predicate's branches from a private clickhouse-local path instead, in the form 05099 already uses. Both directions were measured rather than argued. 05212_backup_log_zero_byte_first_data_file truncates a data file and records it as empty in sizes.json, which is what the predicate reads, and covers its branches separately. A Log table whose first data file records no bytes while a later one still does needs the loop over the recorded sizes to keep it. A Log table where no data file records bytes at all, while __marks.mrk still records 100 rows, needs the marks fallback. A TinyLog table in that first shape keeps no marks for anything to fall back on, so the loop is the only thing that can keep it, which is the mirrored case the countResample column used to reach at index 0 directly. Restoring both src/Storages/StorageLog files to 98afba8~1 reddens all three arms and leaves 05211 green. Its tables describe rows in files that do not hold them, so every statement runs in clickhouse-local against a private path and nothing is fabricated under a shared server. ClickHouse#119728 carries the same rewrite, so once this merges it can take master's version of these two files. The zero-byte data file is the subject of the test but is invisible to any query, so s.bin's size is asserted from data_paths[1] on the source and on the restored table. Co-Authored-By: Claude Opus 5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 7 findings over four rounds, all
Also noted, not blocking: the Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-10:20260914-173037 |
|
Workflow [PR], commit [d6bdabc] Summary: ✅ AI ReviewSummaryThis PR rewrites Final VerdictStatus: ✅ Approve |
…rst_data_file All three arms ended at one of StorageLog::hasNothingToBackUp's "keep the data" outcomes: two are kept by a data file that records bytes, one by its marks. None reached the outcome where a table has nothing to preserve because no data file records bytes and the engine keeps no marks, so a change that started backing up such a table passed the file. Add that arm, as the second arm's fabrication on TinyLog: the engine is the only difference between the two, which is what makes the marks visibly the whole reason one table keeps its data and the other does not. Measured with the size check narrowed to require marks, the new arm is the only line in either test that reddens, and 05211 stays green. Dropping just the !use_marks_file disjunct changes nothing anywhere: loadMarks returns before loading anything when the engine keeps no marks, so marks.empty() already covers that case. The arm reads the backup manifest for the same file name twice, once while it still records bytes, so a zero cannot come from a name that never matches. Co-Authored-By: Claude Opus 5 <[email protected]>
|
@groeneai is this fixing a CI failure? |
|
Yes. It stops the The carrier is This PR only removes that carrier, so that master goes quiet while the server-side fix is still in review; the split was asked for in #119858 (comment). The actual defect stays with #119728 and issue #119727. |
|
We should go with #119728 instead |
|
Understood, and I will not reopen this one. On the master noise: #119728 already carries the same 05211 fixture rewrite ( Two things live only here, both added after the split and both wanted per #119858 (comment): the on-disk The signature is still firing meanwhile: 77 rows in the last 7 days over 65 pull requests, 9 of them true-master, most recently 2026-09-17 12:24:48Z on master itself ( |
Related: #119727
Related: #119722
Related: #119728
Related: #119858 (comment)
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Test-only.
05211_backup_log_zero_byte_data_fileno longer builds an aggregate function state that serializes to zero bytes, so it stops leaving behind a table whose reads fail withInvalid number of columns in chunk pushed to OutputPort.Description
05211_backup_log_zero_byte_data_filebuilds its zero-byte-data-file fixture from a column ofcountResample(10, 5, 1)states. The range is empty, so every state serializes to nothing and the column reads back as zero rows while__marks.mrkrecords 100.LogSource::readDatadrops the empty column, a short chunk reaches a two-column output port, and any reader of the table it leaves behind aborts withInvalid number of columns in chunk pushed to OutputPort. Expected 2, found 1(#119727). 05211 itself reportsOK, so the abort lands on whatever ran next, which is why it reds master and unrelated pull requests.This split was asked for on #119858 so master goes quiet while #119728 finishes review; no source change here. The carrier becomes an all-empty
Array(UInt64)column: its element stream receives nothing, sos.binis 0 bytes beside a populateds.size0.bin, the same on-disk condition without the broken read path. No query can observe a file's size, so the fixture asserts it fromdata_paths[1]. #119728 carries the same rewrite and can take master's version once this merges.The swap costs one of 05211's two carriers: reverting
BackupImpl::copyFileToDiskstill reds every restored arm, revertingStorageLog::hasNothingToBackUpno longer does, because an array column's first data file is its always-populated sizes stream. Only an empty aggregate state can put a zero-byte data file first while rows exist, so05212_backup_log_zero_byte_first_data_filecovers that predicate directly, fabricating the recorded size under a privateclickhouse-localpath as05099_log_array_missing_elementsdoes. Four arms:LogandTinyLogeach kept by a later data file,Logkept by its marks, andTinyLogwith neither, whose data the backup must omit. Reverting bothStorageLogfiles reds the first three and leaves 05211 green; narrowing the predicate to require marks reds the fourth.Validated on a master build with no source change: 50 randomized runs of both pass.
Workflow [PR]
Sync PR [sync-upstream/pr/120048]