Skip to content

Fix FileLog reading a replaced or rotated file from the old file's offset - #124068

Open
groeneai wants to merge 17 commits into
ClickHouse:masterfrom
groeneai:fix-filelog-replaced-file-old-offset
Open

groeneai wants to merge 17 commits into
ClickHouse:masterfrom
groeneai:fix-filelog-replaced-file-old-offset

Conversation

@groeneai

@groeneai groeneai commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #123368

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fixed FileLog reading a file that replaced another one under the same name (moved over it, or created again after a rotation renamed the old file, as logrotate does) from the old file's offset when the replacement happened before the table noticed it: the new file was read twice and rows of the rotated file could be lost. A single-file FileLog table now reads a replaced file from its start.

Description

On 26.8.2.7, a FileLog directory table with a materialized view whose file is rotated by logrotate or replaced by mv before the table applies the directory event loses the rows of the rotated file and reads the new file twice:

seq 100 109 > dir/a.csv
CREATE TABLE src (a UInt64) ENGINE = FileLog('dir/', 'CSV');
mv dir/a.csv dir/a.csv.1; seq 200 209 > dir/a.csv
CREATE TABLE dst (a UInt64) ENGINE = MergeTree ORDER BY a;
CREATE MATERIALIZED VIEW mv TO dst AS SELECT a FROM src;
-- dst: 200..209 twice, 100..109 missing

Root cause: openFilesAndSetPos seeks a file opened by name to the offset of the inode cached for that name, while a streaming round applies directory events only after reading; the path-to-inode check ran only after a failed open.

Change: on every open, the file is read only if the path still leads to the inode its offset is kept for; a replaced name waits for its events to re-key it, so the new file is read once from its start and the rotated file from its offset. A name that gets no event when it leads to another file (a single-file table; on Linux, a symlink whose target was replaced) is re-keyed before the open and before SYSTEM RESET FILELOG sets its offset, taking over the offset of a name that no longer leads there (swapped targets), and waits while one still does. A named reset fails when its name leads to a file it is not read as. Limit: a replacement before the directory watch is installed is read after its next event or a reload.

Validation: the new test fails on master, passes 50/50. With rotation every 200 lines, master duplicated rows in 6 of 40 runs, the fix in none. All FileLog tests pass.


Workflow [PR]
Sync PR [sync-upstream/pr/124068]

groeneai and others added 2 commits October 5, 2026 16:39
…fset

openFilesAndSetPos opens each file by name and seeks it to the offset saved
for the inode cached for that name. The cached inode changes only when the
directory events are applied, and a streaming round applies them after
reading. So when the file at a name was replaced (`mv` over it) or rotated
(`logrotate` create mode: renamed, then created again) after the table cached
it and before it applied the events, the new file was read from the old
file's offset, and then once more from 0 when the events re-keyed the name:
the new file arrived twice, and in a rotation the rows of the rotated file
were lost, because the read advanced the old inode's offset that the rename
then carried over to the rotated file. A single-file table, which has no
directory events, kept reading a replaced file from the old offset forever.

The check that the path still leads to the cached inode existed, but only
after a failed open. Run it for every open, before and after it:

- before: a name whose directory entry did not change (a single-file table,
  a symlink whose target was replaced) gets no event when it leads to
  another file, so it is re-keyed now and read from its start, unless that
  file is already read under another name. The macOS watcher reports a
  replaced symlink target as a new file, so there a directory table leaves
  the re-key to its events. The inode of the entry itself (lstat) is cached
  for this test: a regular file replaced by a symlink moved over it changes
  the entry and does produce an event (an unpaired IN_MOVED_TO, reported as
  ADDED, which resets the offset), so re-keying it here as well would read
  the file twice. Only a symlink entry counts as unchanged, because the
  inodes of the name and of its entry are read by two calls. SYSTEM RESET
  FILELOG re-keys such a name the same way before it sets the offset, so the
  offset is for the file the name leads to now.
- after: the opened file is read only if the path still leads to the inode
  the offset is kept for. Otherwise a replaced entry waits for its pending
  directory events to re-key it, so the new file is read once from its start
  and the rotated file from its own offset; until then it costs one open and
  close per poll. The reader is a std::ifstream, whose descriptor is not
  accessible in C++23, so the identity is checked by path on both sides of
  the open.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Remove comments that narrate the new code in StorageFileLog.cpp; shorten two to one line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-self PR origin: self-found defect (impact-bar validated) labels Oct 5, 2026
@groeneai

groeneai commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 4 rounds, 10 findings) plus my own review.

# Sev Finding Verdict Evidence / action
1 ❌ A symlink moved over a watched name is re-keyed at open, then its ADDED event resets the offset: read twice AGREE, fixed the entry inode is cached; only an unchanged entry is re-keyed at open; new test arm
2 ⚠️ No test exercises the post-open identity check AGREE, fixed a replaced name with events is refused after the open, so 3 arms fail when the check is deleted
3 ⚠️ The rotation arm uses a zero saved offset AGREE, fixed offset 20 set before the rotation, new file shorter than it
4 ⚠️ On macOS the watcher reports a replaced symlink target, so the re-key at open reads it twice AGREE, fixed no re-key at open in a directory table on macOS; its events re-key the name
5 ⚠️ No test exercises the re-key of a symlink whose target was replaced AGREE, fixed new test arm (unchanged entry, saved offset); fails when the re-key is disabled
6 💡 Duplicated "not read this poll" block AGREE, fixed one local lambda
7 💡 A replacement made before the watch is installed gets no event AGREE, noted stated in the description; master already never reads a file created then
8 ⚠️ SYSTEM RESET FILELOG ... OFFSET set after a replacement without an event is dropped by the re-key at open AGREE, fixed one re-key helper, also called by the reset before it sets the offset; new test step
9 ⚠️ The inodes of a name and of its entry come from two calls, so a regular file replaced between them is re-keyed at open, then reset by its event AGREE, fixed in a directory table only a symlink entry is re-keyed at open
10 ❌ A symlink whose new target is read under another name is skipped, and stays unread after that name is removed DISAGREE only before the symlink's first read; a reset, a reload or an event on the name re-keys it. Master reads it from the old target's offset; a retry would re-read from 0 what the other name delivered
11 ⚠️ A symlink replaced by another symlink between the two calls that read its inodes is read twice DISAGREE either call order leaves it: the later ADDED event resets a file the earlier event already keyed, as on master (wider window there)
12 ⚠️ The check after the open is by path, not by the opened stream DISAGREE a wrong read needs the replaced file renamed back between two consecutive syscalls; std::ifstream has no descriptor in C++23
13 💡 A named SYSTEM RESET FILELOG of such a symlink returns success without effect AGREE, noted the state is consistent: the name is not read, as the next open also decides

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are
terminal per finding. Findings on hunks unchanged by the fix round are auto-dropped.

Session id: cron:clickhouse-review-self-slot-58:20261005-165200

@clickhouse-gh

clickhouse-gh Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [bb45287]

Summary: ✅


AI Review

Summary

Reviewed bb452871c8246caf1bd3233fb5c9c9abca4c4aa7. This fixes FileLog applying stale offsets to replacement files and preserves offsets through ownership transfers and rotation chains. No new actionable findings. Both added regression tests matched their references using this head's Fast test binary; focused checks also passed for named resets during a three-file cycle, reset-all with a fresh inode, and saved offsets after reattach.

Findings

⚠️ Majors — previously dismissed

  • src/Storages/FileLog/StorageFileLog.cpp:701 — [dismissed by author -- https://github.com/Fix FileLog reading a replaced or rotated file from the old file's offset #124068#discussion_r4189581796]. Re-keying a replaced symlink still discards its old target's offset when another matching hard link was excluded from the tracked names. Reconfirmed: appended rows remain unread until reattach, which also replays consumed rows. Maintainers explicitly accepted this pre-existing limitation and deferred alias handoff to PR #123673, subsequently closed without merging. This remains an accepted scope decision; no thread was reopened or duplicated.
Final Verdict

Status: ✅ Approve

No new changes requested. The previously dismissed finding is retained above for completeness.

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Oct 5, 2026
Comment thread src/Storages/FileLog/StorageFileLog.cpp Resolved
@clickhouse-gh clickhouse-gh Bot added the comp-message-queues Message queue integrations (Kafka, RabbitMQ, NATS table engines for stream ingestion/egress). label Oct 5, 2026
…e written

`SYSTEM RESET FILELOG` re-keyed a name whose file was replaced without an
event (a single-file table, or a symlink whose target was replaced) before
writing the temporary meta files: it erased the old offset, deleted the old
meta file and switched the inode. A failed write then left the table re-keyed
although the command reported an error, and when the unlink of the old meta
file itself failed (a read-only metadata directory), `meta_by_inode` lost the
entry and the next read hit the size assertion of `file_infos`.

The inode to read a name as is now computed without changing state, kept in
the reset target, and applied together with the new meta files once all of
them are written. The read path removes the old meta file before it changes
anything in memory.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread src/Storages/FileLog/StorageFileLog.cpp Resolved
…the name

The command returned success while changing nothing when the name is a
symlink whose target was replaced by a file read under another name, and it
set the position of the old file when the file at the name was replaced but
its directory event was not applied yet (the event then reads the replacement
from its start). Both now throw BAD_ARGUMENTS, as a reset of a name whose
creation event is not applied yet already does.

The test also checks that an offset set after a replacement in a single-file
table survives DETACH and ATTACH: the immediate read rewrites the meta file
from memory, so it cannot see what the reset wrote.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread src/Storages/FileLog/StorageFileLog.cpp Resolved
@clickhouse-gh

clickhouse-gh Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing bb452871c with master 7b7a971eb (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

11 translation units recompiled, 38 s compile time in total, 11 of them have a recent master baseline.

Median compile-time ratio to the baselines is ×1.07 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio.
The matched translation units cost +1.1 s (+3%) in total before that adjustment.

Job report

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Merged master (includes #128067, which makes Build profile diff stop failing on LogClusterNotReady when the CI logs cluster is overloaded). That was the only red job in the public CI.

@groeneai, investigate the CH Inc sync failures: https://github.com/ClickHouse/clickhouse-private/pull/79580 (test_storage_iceberg_with_spark/test_compaction*.py on amd_tsan and amd_msan, 04545_replace_shared_set_join_dropped_inner on SharedCatalog). They don't touch FileLog. Please fix them in a separate PR, or link the fix here if one is already in progress.

@groeneai

Copy link
Copy Markdown
Collaborator Author

test_storage_iceberg_with_spark/test_compaction*: this comes from #127670. MultipleFileWriter now cuts a file when buffer->count() reaches the limit. With output_format_parquet_parallel_encoding = 1 (the default), a row group reaches the buffer only when a later write() reaps it from the encoder threads, so where the file is cut depends on how fast the encoders are. On slow builds the cut comes late or not at all. I described this on #127670: #127670 (comment)

Measured on master 0525e0c7 (debug, clickhouse local) with the setup of 05444 (4096 rows of 1 KiB random strings, iceberg_insert_max_bytes_in_data_file = '1Mi', 100-row row groups, zstd), changing only the encoding:

Parquet encoding runs files largest file
parallel_encoding = 0 5 4 every time 1.14 MB
parallel_encoding = 1 5 2 or 3 1.6 to 2.1 MB
parallel_encoding = 1, taskset to 2 CPUs 3 2, 2, 1 2.3 to 3.9 MB

With slow encoder threads all 4096 rows can end up in one file, which would fail a test that expects a file above the upper threshold to be split. 05444 does not see this because it sets output_format_parquet_parallel_encoding = 0.

I will open a separate PR that makes the check exact: finish the row groups in flight before comparing (option A on #127670), unless you prefer the estimate (B).

04545_replace_shared_set_join_dropped_inner: the test and the SharedSet / SharedDatabaseCatalog code it exercises are not in the public repository, and clickhouse-private is not readable by this account, so I can't reproduce or fix it from here.

@groeneai

Copy link
Copy Markdown
Collaborator Author

Correction to the above: the fix is already in progress in #127864, so I won't open a second PR. It makes MultipleFileWriter wait for the row groups still being encoded when they could take the file to the limit. Its new 05444 case (100-row row groups of 1 KiB random strings, output_format_parquet_parallel_encoding = 1) passed the amd_tsan and amd_msan flaky checks 50 of 50 at its head f62ba5cd, the builds where the test_compaction* reds are. Review is requested from you there.

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Merged master (clean merge; StorageFileLog.cpp builds and 05326_file_log_replaced_file passes locally). Previous red checks are unrelated to this PR:

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Merged master (clean merge; StorageFileLog.cpp builds). The previous red run on 1714b03 had 0 failed tests in the Praktika report: the ~34-minute job failures (stateless, integration, stress, performance) were jobs dropped by CI infrastructure (Mergeable Check: Failed: 0, Dropped: 26), not test failures. The fresh push re-runs CI.

Comment thread src/Storages/FileLog/StorageFileLog.cpp Resolved
groeneai and others added 2 commits November 6, 2026 21:47
A name that leads, with no directory event, to a file whose offset is kept
for another name was skipped and never visited again. When that other name
then moved on to a new file, as with symlink targets rotated by logrotate,
no name read the file until the table was attached again (master reads it).
The open now marks such a name to be retried, and so does a reset of all
names that skips it.

The rotated file's old offset is still not passed to the new name; that is
the releaseInode follow-up agreed with ClickHouse#123673.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The test is new in this PR, and the Fast test fails a new test that runs
longer than 15 s: it took 16.6 s there after the case for rotated symlink
targets was added. The six cases use their own tables and directories, so
they now run concurrently, each printing to its own file, and the output is
printed in the original order. Each case drops its own tables at its end.
Local debug build: 18 s -> 4.5-6.7 s (50 runs), up to 9.6 s with -j 8.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

groeneai commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 91da995

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel) / 05515_global_subquery_projection_where not from this PR (the test is not in its diff): Code: 47 UNKNOWN_IDENTIFIER on a _data_<hash> name at the INSERT, deterministic on master in this lane since the test was added #129836 (mine, open)
Mergeable Check, PR praktika rollups of the row above #129836 (the owner of the row above)

No job was dropped, and CH Inc sync passed. CIDB has no other FAIL or ERROR row on this head.

Session id: cron:our-pr-ci-monitor:20261107-023005

@antaljanosbenjamin antaljanosbenjamin self-assigned this Nov 9, 2026
…d-file-old-offset

Conflict in `StorageFileLog::openFilesAndSetPos`: master added a narrower check that skips
a tracked name leading to another inode; the PR's check already covers it (and also handles
untracked names), so the PR side is kept.
@alexey-milovidov

alexey-milovidov commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

🕵 Merged master to resolve the conflict in StorageFileLog::openFilesAndSetPos. Master (commit 6e2aed5, from the shared FileLog watch-thread change) added a narrower check that skips a name tracked by directory events when it leads to another inode. This PR's check already covers that case and also handles untracked names, so I kept the PR side. clickhouse builds. 05326_file_log_replaced_file and the other FileLog stateless tests pass locally, except for diffs that come from my minimal local server config (no test_shard_localhost cluster).

The previous red job (05515_global_subquery_projection_where in ParallelReplicas) is unrelated. It is fixed on master by 1cfc5bb (Do not rewrite GLOBAL IN in projection queries with parallel replicas), which this merge pulls in.

Comment thread src/Storages/FileLog/StorageFileLog.cpp Resolved
A name that gets no directory event for its new file (on Linux, a
symlink whose target was replaced) was deferred while that file was
cached under any other name. When two symlinks' targets are swapped
(or rotated in a cycle), each name's new file is cached under the other
name, so both were deferred forever and never read again until a
reattach; SYSTEM RESET FILELOG returned success without effect, and a
named reset failed. Master reads both files.

Now a name is deferred only while another name still leads to the file
(`isReadUnderOtherName`). If the file is cached under a name that leads
elsewhere, the two names swap their files, offsets and meta files
included, as `loadFiles` does by inode at a reload: the files are read
on from their own offsets. `openFilesAndSetPos` does these take-overs
before any re-key to a new file, which drops the offset of the file it
leaves (the order the macOS watcher also keeps for renames). The reset
path takes over before staging, unless a staged target keeps that file.

Measured on a debug build (.scratch/maint-r5-cycle.sh): swap before the
first read [100,200] (head: nothing, five reads); a three-name rotation
[100,200,300]; read, detach, append, attach, swap: only the appended
[104,201] (head: nothing; master [101,102,103,104,200,201] and more
duplicates after a reattach); a.csv to a new file and b.csv to a.csv's
old one: [202,300] (head and master read 200 and 201 again).

Tests: a 05326 case with swapped symlink targets (read, then swapped
back and reset), and 05326_file_log_symlink_targets_offsets for saved
offsets through a swap and a rotation (no-darwin: the macOS watcher
reports these as directory events).

Reported by clickhouse-gh in
ClickHouse#124068 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread src/Storages/FileLog/StorageFileLog.cpp Resolved
groeneai and others added 2 commits November 15, 2026 01:14
`takeOverFile` gave the other name the file that the taking name left, but
kept that name's status, so an inactive name (`NO_CHANGE`, not retried)
never opened its new file. With `a.csv -> x` and `b.csv -> y`, `y` moved
aside while `a.csv` is read and the targets then rotated (`x` to `y`, the
old `y` to `x`), the unread file of `a.csv` was read only after a reattach:
in direct SELECTs, in a materialized view, and after
`SYSTEM RESET FILELOG ... FILE 'b.csv' TO END`.

The other name is now retried like a name whose open failed: it is opened
in the same pass when the take-over runs before the main loop, else in the
next pass (`any_open_failed` keeps the background task polling). Its reader
is dropped, so no stream reads a file whose offset moved to another name.

A name that leads to no file is neither retried nor opened (also when it is
`OPEN` after an attach): a failed open of a dangling name drops the offset of
its file, so a half-completed swap (the old file of `a.csv` still under a
temporary name when `a.csv` takes over) read that file again from 0 once it
came back under `b.csv` (Gate B).

Reported by clickhouse-gh on ClickHouse#124068 (r4576214240).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…no file

`takeOverFile` did not retry a name that led to no file at take-over time,
so that the failed open would not drop the offset it had just been given.
Restoring a target outside the watched directory gives no event, so the name
stayed `NO_CHANGE` and its file was read only after a reattach. With
`a.csv -> x` and `b.csv -> y`, `x` moved aside and `y` moved to `x` before
the first read, and the old `x` then moved to `y`, `100,101` stayed unread
in direct SELECTs, in a materialized view and after a named
`SYSTEM RESET FILELOG`; a fresh file created at `y` stayed unread too.

The other name is now always retried, and a name that leads to no file
follows the existing rule: what appears there later is read from its start.
Keeping the offset instead is unsafe, because only the inode number
identifies the file: after `mv y x` frees the inode of `x`, a new `y`
often gets the same number (7 of 12 runs here, xfs), and was then read from
the old file's offset, skipping its first rows. The previous code did that
at the next reattach. So a file that comes back under a name that led to no
file is read again from its start, as for any other such name.

Master aborts in the first scenario on the `file_names.size() ==
meta_by_inode.size()` assertion after reading the restored file.

Reported by clickhouse-gh on ClickHouse#124068 (r4576622731).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread src/Storages/FileLog/StorageFileLog.cpp Resolved
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - ff60021

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
AST fuzzer (amd_release, oracle) / AST fuzzer oracle mismatch not from this PR (it changes only FileLog): the subquery-wrap oracle differs for SELECT DISTINCT *, t1.id, t3.id FROM t1_00848 AS t1 FULL OUTER JOIN t3_00848 AS t3 USING (id), a duplicate-name USING key shape that also reproduces on a master build #107127 (mine, open)
Performance Comparison (arm_release, master_head, 3/6) infra, not from this PR: the job was killed by the 7200 s job timeout (Job timed out ... exit code [-15]) 100 min into its 142 benchmark tests, so no report was written. The same kill hit this shard on 3 other unrelated PRs between 05:58Z and 06:25Z; master's 3/6 at the same base ran a different list of 147 tests in 47 to 56 min a fix task is created (investigating at full effort, fixing-PR link to follow here)
Finish Workflow / Post Hooks (can_be_merged.py --review-threads), Review Threads one unresolved blocking review thread at the end of this run (the run itself was the full suite: config_limited [False]) PR-caused by design and owned by this PR (#124068): the resolution is addressing the blocking review thread(s)
CH Inc sync private sync CH Inc sync (private, not actionable by me)
Mergeable Check, PR praktika rollups of the rows above #107127, a fix task is created and #124068 (the owners above)

Session id: cron:our-pr-ci-monitor:20261115-083014

@groeneai

Copy link
Copy Markdown
Collaborator Author

Fixing PR for the Performance Comparison (arm_release, master_head, 3/6) timeout rows in my CI finish ledger above: #131772. A NightlyCoverage run that collected no test was accepted as the coverage cohort, so every performance test became mandatory with all queries and the shards hit the 7200 s limit.

arwenizEr pushed a commit to arwenizEr/ClickHouse that referenced this pull request Nov 18, 2026
…adroom baseline

`master_baseline` took the nearest commit of the run's master chain whose
`Build (amd_msan)` report existed and skipped every commit without one. A master
job uploads its report only in `post_run`, so a parent that is still building
looked like one that never builds, and the PR was compared with an older commit.
On 2026-11-14 ClickHouse#117346 (`Use clang-23`) moved the msan layout by -16.23 MiB; its
own master build ran until 20:42Z, and ClickHouse#124068, ClickHouse#131668 and ClickHouse#117318, checked a
few seconds earlier, were compared with the commit before it and failed with
exactly master's delta.

Apply the rule the performance delta gate uses for the same walk
(`classify_missing_prev_master_run`, 8b06c76): when the job report is
missing, read the commit's MasterCI summary and skip the commit only when MasterCI
never ran there, the run has no such job, or the job is `SKIPPED`. Any other
status, a report without the headroom row, or a lookup error other than 403/404
stops the walk: no baseline (the header names the commit and its status) or the
existing `ERROR`. A PR success without a baseline because the walk stopped is not
cached, since master's state is not a build digest input.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
alexey-milovidov and others added 2 commits November 23, 2026 18:27
…es over a file

A take-over makes the name it takes the file from retried. In a rotation of three
files where the name in the middle was not active (e.g. after a named
`SYSTEM RESET FILELOG` of the other two), that name became active only behind the
single take-over pass, so the main pass of `openFilesAndSetPos` re-keyed the first
name to its new file and dropped the offset of its old file before the name in the
middle could take it over, and the old file was read again from the start.

The pass is now repeated until it makes no take-over. Every take-over gives one more
name the file it leads to, so the number of passes is bounded by the number of names.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Merged master and addressed the open review thread (bb45287).

The AST fuzzer (amd_release, oracle) failure (Subquery wrap oracle mismatch on SELECT DISTINCT *, t1.id, t3.id FROM t1_00848 AS t1 FULL OUTER JOIN t3_00848 AS t3 USING (id)) is unrelated to FileLog; it is the known open issue #118986. Report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=124068&sha=ff60021ba2f94777cde43eaf00bc0918e996b3e0&name_0=PR&name_1=AST%20fuzzer%20%28amd_release%2C%20oracle%29

@groeneai, if a fix for that issue is already in progress, link it here.

@groeneai

Copy link
Copy Markdown
Collaborator Author

The in-progress fix for #118986 is my open PR #107127. When a subquery has two same-named output columns backed by different expressions (here the USING key id from * and t1.id), it gives the later one a unique internal name, so the wrapping SELECT * no longer reads the key's value for t1.id.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-message-queues Message queue integrations (Kafka, RabbitMQ, NATS table engines for stream ingestion/egress). groeneai-origin-self PR origin: self-found defect (impact-bar validated) pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants