Skip to content

Fix flaky 05315_plain_rewritable_part_removal_without_copies in the hour repeated at the end of DST - #127763

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-05315-dst-repeated-hour
Oct 25, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-05315-dst-repeated-hour

Conversation

@groeneai

@groeneai groeneai commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #123637

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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

...

Description

05315_plain_rewritable_part_removal_without_copies took the TRUNCATE cut-off as local time text (SELECT now64(6)) and filtered system.blob_storage_log with event_time_microseconds >= '<text>'. When DST ends, one local hour happens twice, and its text parses back to the first occurrence. The CI server zone is Europe/Amsterdam, which left CEST at 2026-10-25 01:00 UTC, so a run in that zone between 01:00 and 02:00 UTC moved the bound one hour back and also counted the CopyObject events of the check's own CREATE and INSERTs: copies was 1 (plain disk) and 3 (encrypted disk) instead of 0. It failed 11 times in that hour, on master and on 7 unrelated PRs (e.g. PR 125239), and never in the 30 days before.

The cut-off is now toUnixTimestamp64Micro(now64(6)), compared with toUnixTimestamp64Micro(event_time_microseconds) as 04949_modulo_partition_key_remove_part_log does, so it is the same instant in every time zone, at the same microsecond precision. The .reference does not change. Same class as #127762 (05045_create_token).

Validation on a Europe/Amsterdam server with MinIO:

  • the old predicate with the master job's cut-off 2026-10-25 02:55:23.152962 (taken at 01:55:23 UTC) selects events from 00:55:23 UTC, including the insert copies; the new one from 01:55:23 UTC;
  • the old test with its cut-off moved one hour back gives exactly the CI diff, 5/5; the new test with the same shift fails the same way, so the bound still matters;
  • the new test passes 50/50 with random settings, 40/40 with 8 parallel workers, and in each session_timezone the runner draws plus UTC.

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

Version info

  • Merged into: 26.11.1.757-master (included in 26.11 and later)

…d DST hour

The test took the `TRUNCATE` cut-off as local time text (`SELECT now64(6)`)
and compared `event_time_microseconds` with that text. When DST ends, the
local hour 02:00-03:00 occurs twice, and a text taken in the second pass is
parsed back to the first occurrence, one hour earlier. The window then also
covered the check's own `CREATE` and `INSERT`s, whose `CopyObject` events
gave `copies` 1 (plain disk) and 3 (encrypted disk) instead of 0. This
reddened master and seven PRs on 2026-10-25 between 01:00 and 02:00 UTC
(the CI server zone is Europe/Amsterdam).

Take the cut-off as `toUnixTimestamp64Micro(now64(6))` and compare it with
`toUnixTimestamp64Micro(event_time_microseconds)`, as
04949_modulo_partition_key_remove_part_log.sh does. The integer has no time
zone, so the bound is the same instant for every session time zone, at the
same microsecond precision.

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

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

Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review of the diff (0 findings).

No findings to adjudicate. Checked: the integer cut-off and blob_storage_log.event_time_microseconds (DateTime64(6)) compare at the same microsecond precision; outside the repeated hour the bound is numerically the old one, so the .reference does not change; both check calls share the changed lines; no other value in the test is a time.

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

Session id: cron:clickhouse-review-slot-8:20261025-031500

@clickhouse-gh

clickhouse-gh Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [fcfc640]

Summary: ✅


AI Review

Summary

PR #127763 fixes DST-related flakiness in 05315_plain_rewritable_part_removal_without_copies by comparing Unix timestamps in microseconds instead of parsing an ambiguous local-time string. Reviewed the complete diff and surrounding code at fcfc640e92aecf8bde7deaddb30086dee7f83cf4, including all prior discussion. No actionable findings.

Missing context / blind spots
  • ⚠️ The targeted stateless CI run is still in progress, and I did not rerun the test locally. Runtime evidence relies on the PR's documented DST reproduction, repeated MinIO runs, and time-zone checks; the completed targeted CI results would provide independent confirmation.
Final Verdict

Status: ✅ Approve. No changes requested.

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @alesapin, could you review this and add the can be tested label so CI runs? The test now takes its TRUNCATE cut-off as an integer microsecond timestamp instead of local time text, which parses one hour early in the hour repeated when DST ends and made it count the CopyObject events of its own inserts.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Oct 25, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Oct 25, 2026
@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Oct 25, 2026
@alexey-milovidov alexey-milovidov self-assigned this Oct 25, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 25, 2026
Merged via the queue into ClickHouse:master with commit 519911e Oct 25, 2026
526 of 528 checks passed
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 25, 2026
@clickhouse-gh clickhouse-gh Bot added comp-object-storage-disks Object-storage disk layer: DiskObjectStorage, metadata storage adapters, transaction support for ... and removed comp-testing Test content only (no production code). labels Nov 22, 2026
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-object-storage-disks Object-storage disk layer: DiskObjectStorage, metadata storage adapters, transaction support for ... pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants