Skip to content

Skip startup access check for s3 disks in test_storage_delta_disks (fix flaky test_single_log_file) - #110300

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/delta-disks-s3-skip-access-check
Jul 14, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/delta-disks-s3-skip-access-check

Conversation

@groeneai

@groeneai groeneai commented Jul 13, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

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

Description

Fixes flaky test_storage_delta_disks/test.py::test_single_log_file (seen on Integration tests (amd_tsan, 6/6), all 8 parameterizations failing at once). Reported by @alexey-milovidov on #109246 (a play.html-only PR, unrelated to the failure).

Root cause: the session-scoped started_cluster fixture times out in cluster.start(). On the affected node the server actually starts, then aborts during metadata loading because disk disk_s3_0_with_cache fails its startup S3 access check with a transient 403 AccessDenied while writing the probe object (key .../user_files/..., MinIO logs "signature check failed ... time skew ... Attempting to adjust the signer", one retry, then gives up). The identical-cred sibling disks disk_s3_0_common / disk_s3_1_common pass their access checks ~80 ms earlier on the same MinIO, so this is a transient race during the concurrent 3-node TSAN startup burst, not a credentials/config error. The failed session fixture then cascades to all 8 test_single_log_file parameterizations as instant setup errors (first after ~333 s = the start timeout, the rest instantly).

Fix: skip the startup access check for the s3 disks, mirroring the azure disks in the same generated config which already set skip_access_check=true. This removes the single startup write-probe that intermittently gets the 403; the disks remain fully exercised by the DeltaLake tests themselves.

Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109246&sha=52be366e5cc6bbd0fe2016d997940ceea424d62f&name_0=PR&name_1=Integration%20tests%20%28amd_tsan%2C%206%2F6%29

Version info

  • Merged into: 26.7.1.926 (included in 26.7 and later)

The session-scoped started_cluster fixture flakily times out because a
server node aborts during metadata loading: the s3 disks run a startup
access check that writes and reads back a probe object, and under the
concurrent 3-node TSAN startup burst MinIO intermittently answers that
single write with a transient 403 AccessDenied (signature/time-skew
retry). The identical-cred sibling s3 disks pass their checks moments
earlier, so it is a transient race, not a config error. The failed
session fixture then cascades to all 8 test_single_log_file
parameterizations as instant setup errors.

Skip the startup access check for the s3 disks, mirroring the azure
disks in the same config that already set skip_access_check=true. The
disks are still fully exercised by the DeltaLake tests themselves.

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

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? No — transient MinIO 403 AccessDenied race during the concurrent 3-node TSAN startup burst; cannot be forced on demand. The fix removes the failure mode by construction (drops the startup write-probe that got the 403).
b Root cause explained? Yes. disk_s3_0_with_cache startup access check writes a probe object; under load MinIO intermittently answers with a transient 403 (signature/time-skew, 1 retry then gives up). The server aborts at metadata load, cluster.start() times out, and the session-scoped fixture cascades to all 8 parameterizations.
c Fix matches root cause? Yes — skips the exact startup write-probe that intermittently gets the 403, matching the azure disks in the same config.
d Test intent preserved? Yes. Only the redundant startup access check is skipped; the s3 disks are still fully exercised by the DeltaLake tests. No assertions weakened.
e Demonstrated both directions? N/A — non-deterministic transient race, not reproducible on demand (see a). Fix eliminates the probe operation entirely.
f Fix general, not a narrow patch? Yes — applied to all four s3 disks (disk_s3_0_common, disk_s3_1_common, disk_s3_0_with_cache, disk_s3_1_with_cache), not just the one that failed this run.
g Generalizes across inputs? N/A (test-config fix, not a code bug).
h Backward compatible? N/A (test-config fix, not a code bug).
i Invariants/contracts preserved? N/A (test-config fix, not a code bug).

Session id: cron:clickhouse-worker-slot-5:20260713-173800

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @kssenii - could you review? Test-only fix: skip the startup s3 access check in test_storage_delta_disks (transient MinIO 403 during concurrent TSAN cluster startup was aborting the session fixture), mirroring the azure disks in the same config.

@PedroTadim PedroTadim added the can be tested Allows running workflows for external contributors label Jul 13, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [5a03f97]

Summary: ✅


AI Review

Summary

This PR adds skip_access_check to the S3 disks used by test_storage_delta_disks so the cluster no longer performs the startup access probe that was intermittently failing against MinIO. I traced the config through registerDiskObjectStorage, registerDiskCache, and IDisk::startup: the new keys are live for both the plain S3 disks and the cache-wrapped variants, and the test still exercises those disks through DeltaLake reads after startup. I found no correctness issues in the patch.

Missing context / blind spots
  • ⚠️ The current Praktika report linked from the PR does not include the flaky Integration tests (amd_tsan, 6/6) shard, so I could not confirm this branch in the exact environment that originally hit the transient 403. A rerun of that shard would close the loop.
Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jul 13, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger — 5a03f97

CI fully finished (Finish Workflow SUCCESS, Mergeable Check SUCCESS). No failing tests in CIDB for this head; no PR-caused failures. Only the private CH Inc sync remains (exempt).

Check / test Reason Owner / fixing PR
CH Inc sync — CH Inc sync (private, not actionable by us)

Session id: cron:our-pr-ci-monitor:20260713-230000

@alexey-milovidov alexey-milovidov self-assigned this Jul 14, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jul 14, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

Probably excessive, but does not harm.

Merged via the queue into ClickHouse:master with commit 3d639fc Jul 14, 2026
175 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 14, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…ks-s3-skip-access-check

Skip startup access check for s3 disks in test_storage_delta_disks (fix flaky test_single_log_file)
awitten1 pushed a commit to awitten1/ClickHouse that referenced this pull request Oct 10, 2026
Both servers of the module (`instance` and `instance_local_metadata`, the
second added in 88a9fbd) load `configs/backups.xml` and run the
`IDisk::startup` access check of `backup_disk_s3_plain` (PUT, GET, DELETE of
`clickhouse_access_check_<uuid>`) at the same time, in the same fresh MinIO
prefix `root/data/disks/disk_s3_plain/` that holds nothing but the two
probes.

MinIO's DELETE removes the object directory and then every now-empty parent
(`cmd/xl-storage.go`, `deleteFile`), while the other server's PUT creates the
same parents in `RenameData -> renameAll -> reliableRename ->
reliableMkdirAll` (`cmd/os-reliable.go`). When a parent is removed between
its EEXIST and the child's mkdir, `os.Mkdir` returns an ENOENT PathError,
and `renameAll` classifies it with `isSysErrPathNotFound` (non-Windows branch
is `pathErr.Err == ENOENT`, `cmd/xl-storage-errors.go`) as
`errFileAccessDenied`, i.e. `403 AccessDenied`, even for the root user. The
code is unchanged in the latest pgsty/silo release.

In the failing job (PR ClickHouse#123069, amd_llvm_coverage 6/8) the denied PUT was
sent at 14:11:26.619465 and failed at .624049, 0.47 ms after `instance`'s
DELETE of its own probe completed (.622793-.623583); the server exited and
all 14 tests failed in `start_cluster`. Two clients doing the same
PUT/GET/DELETE against the same MinIO image locally got 7 and 13
AccessDenied PUTs in two 120 s runs with an empty prefix, and 0 of 49876
with one extra object keeping the prefix non-empty.

With `skip_access_check` neither server writes to MinIO at startup; the
disk is still used by every BACKUP/RESTORE in the module. Same remedy as
ClickHouse#110300 and ClickHouse#110592.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 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.

4 participants