Repository navigation
Conversation
…eated at the end of DST Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eated at the end of DST `ReplicatedMergeTreeLogEntryData` writes `create_time` as wall-clock time of the server time zone and reads it back with `makeDateTime`, which resolves a time inside the hour repeated at the end of DST to its first occurrence. An entry created in the second occurrence therefore reads back `amount_of_offset_change` (one hour) early on every replica, so `system.replicas.absolute_delay` jumps by 3600 s while an insert is being replicated (`Local replica of shard 1 is stale (delay: 3600s.)`, healthy replicas skipped by distributed queries) and `execute_merges_on_single_replica_time_threshold` stops waiting at once. Seen in CI on 2026-10-25 01:00-02:00 UTC (Europe/Amsterdam) in `00563_insert_into_remote_and_zookeeper_long`, `03080_incorrect_join_with_merge`, `03008_deduplication_remote_insert_select` and `01532_execute_merges_on_single_replica_long`. `ReplicatedMergeTreeLogEntry::parse` now replaces an ambiguous value with the creation time of the znode (`stat.ctime`), which is unambiguous and the same on every replica, when that znode was created together with the entry (a `log` znode or a barrier). The format version 1 fallback already takes `create_time` from the same place. Readers of `queue` znodes, whose creation time is the time the entry was pulled or copied, pass `znode_created_with_entry = false` and keep the previous reading. Unambiguous values and the written format are unchanged: older replicas parse the header strictly (fixed-width date-time, `assertEOF`), so an unambiguous on-wire format would need a writer gate and would still not fix entries written by older versions. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Shorten the two new comments on create_time ambiguity and the znode_created_with_entry parameter to one line each. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding) plus my own review.
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261025-041500 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261025-025200 |
|
cc @tavplubix @CheSema, could you review this and add the |
|
Workflow [PR], commit [3e0d568] Summary: ❌
AI ReviewSummaryThe PR disambiguates replication log Final VerdictStatus: ✅ Approve |
CI finish ledger - 3e0d568Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
CIDB has no other Session id: cron:our-pr-ci-monitor:20261025-133007 |
Related: #76867
Related: #127758
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix
create_timeof replication log entries created in the hour repeated at the end of DST in the server time zone. It was read back one hour early, sosystem.replicas.absolute_delayreported 3600 seconds for an up-to-date replica andexecute_merges_on_single_replica_time_thresholddid not wait.Description
On 26.3 and older releases, with a DST server time zone, a replication log entry created in the second pass of the hour repeated at the end of DST is read back one hour early:
create_timeis written as wall-clock text in the server time zone andmakeDateTimeresolves it to the first occurrence.system.replicas.absolute_delaythen reports 3600 s while an insert is being replicated, andexecute_merges_on_single_replica_time_thresholdstops waiting. CI hit it on 2026-10-25 01:00-02:00 UTC (Europe/Amsterdam):00563_insert_into_remote_and_zookeeper_long,03080_incorrect_join_with_mergeand03008_deduplication_remote_insert_selectwithLocal replica of shard 1 is stale (delay: 3600s.)(Fast test, PR 76867), and01532_execute_merges_on_single_replica_long(PR 127758).ReplicatedMergeTreeLogEntry::parsenow replaces an ambiguouscreate_timewith the znode creation time (stat.ctime) when the znode was created with the entry (alogznode or a barrier), so all replicas reading the log agree on it. Readers ofqueueznodes, whose creation time is the pull time, keep the previous reading: after a restart, an unprocessed entry from that hour still reads one hour early. The written format is unchanged: older replicas parse it strictly, and a new format would not fix entries they wrote. Mutation entries use the same encoding, for display only (system.mutations).Validation: the new unit test fails on master and passes with the fix. On a
Europe/Amsterdamserver, a log entry injected withcreate_time: 2026-10-25 02:30:00reads as its znode creation time with the fix (absolute_delay0) and as 02:30 CEST on master.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/127766]