Skip to content

[DRAFT] Replace MinIO with (20x faster) RustFS in stateless CI - #113825

Closed
azat wants to merge 3 commits into
ClickHouse:masterfrom
azat:ci-stateless-rustfs
Closed

azat wants to merge 3 commits into
ClickHouse:masterfrom
azat:ci-stateless-rustfs

Conversation

@azat

@azat azat commented Aug 7, 2026 •

Copy link
Copy Markdown
Member

Note: sadly, but unlikely this will be merged, due to some setups uses MinIO and better to test on CI as well, but worth checking

RustFS is ~20x faster. mc stays for provisioning via the MinIO admin API.

AIStor and integration tests keep MinIO.

Details:

Note, that MinIO has some basic scalability (at least last available OSS version) issues so even disabling fsync (it does not allows to do this, but I did it with strace -qq -f -e inject=fsync,fdatasync:retval=0 -e exit_group -e signal=9 /usr/bin/minio server) and literally nothing changed, strace shows some futex calls (even though it is not 100% accurate since strace itself has overhead)

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):

Replace MinIO with (20x faster) RustFS in stateless CI

@azat
azat marked this pull request as draft August 7, 2026 13:27
@clickhouse-gh

clickhouse-gh Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [d1bd608]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) FAIL
Start ClickHouse Server FAIL
Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, sequential) FAIL
Start ClickHouse Server FAIL
Stateless tests (amd_llvm_coverage, AsyncInsert, s3 storage, sequential) FAIL
Start ClickHouse Server FAIL
Stateless tests (amd_debug, sequential) FAIL
00180_no_seek_avoiding_when_reading_from_cache FAIL cidb
Stateless tests (amd_debug, distributed plan, s3 storage, sequential) FAIL
Start ClickHouse Server FAIL
Build profile diff ERROR
LLVM Coverage DROPPED

AI Review

Summary

This PR replaces the stateless CI S3 backend with RustFS, updates the runner/bootstrap scripts, and adjusts one URL-encoding test for the new server behavior. The CI matrix is green, but there are still two real compatibility gaps: local macOS bootstrap remains broken, and utils/auto-bisect can now carry the wrong object-store backend across commit boundaries.

Findings

⚠️ Majors

  • [ci/jobs/scripts/functional_tests/setup_rustfs.sh:74-77] The local bootstrap path no longer works on macOS. download_binaries still synthesizes rustfs-${os}-$(uname -m)-musl URLs, but the pinned RustFS 1.0.0-beta.11 release only publishes rustfs-macos-aarch64-* assets and no Intel macOS binary. On Apple Silicon, find_arch also rejects arm64, so even the mc download path fails. Local functional-test runs can no longer fetch the stateless S3 backend on any Mac.
  • [utils/auto-bisect/helpers/lib.sh:15] start_minio now switches between setup_minio.sh and setup_rustfs.sh based on the checked-out revision, but it still reuses any existing listener on :11111. A bisect that crosses this PR can therefore run old commits against leftover RustFS or new commits against leftover MinIO, which is enough to misidentify the culprit because the two backends already differ semantically in this PR.
Final Verdict

Needs changes before merge.

wget "https://dl.min.io/aistor/mc/release/${os}-${arch}/archive/mc.RELEASE.${minio_client_version}" -O ./mc
chmod +x ./mc ./minio
# the musl build is static-pie and runs on any libc
wget "https://github.com/rustfs/rustfs/releases/download/${rustfs_version}/rustfs-${os}-$(uname -m)-musl-v${rustfs_version}.zip" -O ./rustfs.zip

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new local download path no longer works on macOS. find_os returns darwin, and uname -m is arm64 or x86_64, so this now requests URLs like rustfs-darwin-arm64-musl-v1.0.0-beta.12.zip. The upstream 1.0.0-beta.12 release publishes macos asset names instead, and it does not ship an Intel macOS binary at all, so local functional-test runs can no longer bootstrap the S3 backend on any Mac.

That breaks the "same binaries for local running scenario" contract called out in the stateless Dockerfile. Please special-case the non-Linux asset naming here, and either fail early with a clear message for unsupported Intel macOS or keep the old MinIO path as the local fallback.

azat added 2 commits August 7, 2026 18:00
beta.12 rejects CopyObject carrying Content-Type without the REPLACE
metadata directive (rustfs#5511), and clickhouse-server always sends
Content-Type on copies; for empty objects the failure escalated to the
"Chosen multipart upload for an empty file" exception. Fixed upstream
by rustfs#5514, but no release contains it yet; beta.11 predates the
regression.
…coding

RustFS URL-decodes the raw request path before splitting it into
bucket/key, so it served the object and the enable_url_encoding=0
query returned data instead of the error the test greps; MinIO treats
the un-decoded path as a bucket name and fails. Use a nonexistent key
so any S3 server errors and the message carries the raw %2F path.
# Different ClickHouse versions have setup_minio.sh in different locations
if [[ -f "$WORK_TREE/tests/docker_scripts/setup_minio.sh" ]]; then
# Different ClickHouse versions have the S3 setup script in different locations
if [[ -f "$WORK_TREE/ci/jobs/scripts/functional_tests/setup_rustfs.sh" ]]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start_minio now chooses between setup_rustfs.sh and setup_minio.sh based on the checked-out tree, but the reuse guard still only checks whether something is already listening on :11111. During utils/auto-bisect, that object-store process stays up while the worktree moves between commits, so a bisect that crosses this PR can run an old revision against leftover RustFS or a new revision against leftover MinIO.

That can point the bisect at the wrong culprit precisely because the backends do not behave identically; the %2F URL-decoding difference fixed by 02833_url_without_path_encoding is one concrete example from this PR. Please persist which backend is running and restart when the requested setup_* script changes, or unconditionally recreate the service here before each candidate.

@azat
azat marked this pull request as ready for review August 8, 2026 07:06
@azat azat changed the title Replace MinIO with (20x faster) RustFS in stateless CI [DRAFT] Replace MinIO with (20x faster) RustFS in stateless CI Aug 8, 2026
@azat

azat commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

Apparently bulk loads works slower with rustfs, since it cannot load datasets on start

@azat
azat marked this pull request as draft August 8, 2026 16:50
@alexey-milovidov

Copy link
Copy Markdown
Member

@azat

azat commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

Agree, and not only because vulnerabilities (the fact that other implementations has less discovered does not mean that they has less of them, we use it only for CI anyway) but at first glance seaweedfs seems more mature

@azat

azat commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

Interesting that it fails on CI for long INSERTs, since INSERT performance is more or less similar to seaweedfs or minio - https://pastila.nl/?00987908/0881e529691fde6923fce720f4e37756#rs/+PLnk5CvNs1g7fMaTEQ==GCM

@azat azat closed this Aug 10, 2026
@azat
azat deleted the ci-stateless-rustfs branch August 10, 2026 20:12
@azat

azat commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

Superseded by #113828

alexey-milovidov pushed a commit to Ergus/ClickHouse that referenced this pull request Nov 6, 2026
A whole-object CopyObject rejected with InvalidArgument, InvalidRequest,
EntityTooLarge (or the GCS rewrite error) is retried as a multipart upload
copy whenever the client supports multipart copy, regardless of the object
size. For an empty object UploadHelper::calculatePartSize rejects size 0
with LOGICAL_ERROR "Chosen multipart upload for an empty file. This must
not happen", which aborts debug builds and servers with
abort_on_logical_error. It is reached on endpoints that reject a zero-size
CopyObject (RustFS), e.g. when a plain_rewritable S3 disk unlinks an empty
file, because the unlink copies the blob first (STID 0250-04e2 in the CI of
ClickHouse#113825).

An empty object now takes the existing regular-upload fallback, as it does
for AccessDenied or without multipart copy support: a single-part PutObject
of an empty body, so the copy completes.

The same precondition was violated one step further: a zero-size PutObject
rejected with EntityTooLarge / InvalidRequest also fell back to a multipart
upload. A multipart upload cannot write an empty object either, so the
endpoint's own error is reported instead.

The guard in calculatePartSize stays as the invariant; the callers were
wrong.

Closes ClickHouse#129218

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants