Skip to content

Ignore only not found errors for s3_plain_rewritable (and some other S3 code)#87426

Merged
azat merged 2 commits intoClickHouse:masterfrom
azat:s3-exists
Sep 23, 2025
Merged

Ignore only not found errors for s3_plain_rewritable (and some other S3 code)#87426
azat merged 2 commits intoClickHouse:masterfrom
azat:s3-exists

Conversation

@azat
Copy link
Copy Markdown
Member

@azat azat commented Sep 22, 2025

MergeTree code does call readFileIfExists() in some places. For s3_plain_rewritable, however, existsFile() looks unsafe because it ignores all errors from S3.

For example, you might get an error such as "Response status: 503, Slow Down" from S3. In that case, with s3_slow_all_threads_after_retryable_error, the number of retries is reduced to 1 (#85918), which makes it possible to get false from existsFile()

Example stacktrace:

DB::S3::(anonymous namespace)::tryGetObjectInfo()
DB::S3::getObjectInfo()
DB::S3ObjectStorage::tryGetObjectMetadata()
DB::MetadataStorageFromPlainObjectStorage::getObjectMetadataEntryWithCache()
DB::MetadataStorageFromPlainObjectStorage::getObjectMetadataEntryWithCache()
DB::MetadataStorageFromPlainRewritableObjectStorage::existsFile()

Changelog category (leave one):

  • Critical Bug Fix (crash, data loss, RBAC) or LOGICAL_ERROR

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

Ignore only not found errors for s3_plain_rewritable (which may lead to all sort of troubles)

@azat azat requested a review from jkartseva September 22, 2025 19:34
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Sep 22, 2025

Workflow [PR], commit [fe78530]

Summary:

job_name test_name status info comment
Stateless tests (amd_binary, ParallelReplicas, s3 storage, parallel) failure
03252_check_number_of_arguments_for_dynamic FAIL
02122_parallel_formatting_PrettyNoEscapes FAIL
Exception in test runner FAIL
Killed by signal (in clickhouse-server.log or clickhouse-server.err.log) FAIL
Fatal messages (in clickhouse-server.log or clickhouse-server.err.log) FAIL
Finish Workflow failure
python3 ./ci/jobs/scripts/workflow_hooks/new_tests_check.py failure

@clickhouse-gh clickhouse-gh bot added pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-cloud labels Sep 22, 2025
@azat azat force-pushed the s3-exists branch 2 times, most recently from 78d063e to 7bc0cce Compare September 22, 2025 20:33
…S3 code)

MergeTree code does call readFileIfExists() in some places. For
s3_plain_rewritable, however, existsFile() looks unsafe because it
ignores **all** errors from S3.

For example, you might get an error such as "Response status: 503, Slow Down"
from S3. In that case, with s3_slow_all_threads_after_retryable_error,
the number of retries is reduced to 1, which makes it possible to get
false from existsFile()

Example stacktrace:

    DB::S3::(anonymous namespace)::tryGetObjectInfo()
    DB::S3::getObjectInfo()
    DB::S3ObjectStorage::tryGetObjectMetadata()
    DB::MetadataStorageFromPlainObjectStorage::getObjectMetadataEntryWithCache()
    DB::MetadataStorageFromPlainObjectStorage::getObjectMetadataEntryWithCache()
    DB::MetadataStorageFromPlainRewritableObjectStorage::existsFile()
@nikitamikhaylov nikitamikhaylov self-assigned this Sep 22, 2025
@azat azat enabled auto-merge September 23, 2025 06:01
@azat
Copy link
Copy Markdown
Member Author

azat commented Sep 23, 2025

CI failures are unrelated

@azat azat added this pull request to the merge queue Sep 23, 2025
Merged via the queue into ClickHouse:master with commit f51963d Sep 23, 2025
120 of 123 checks passed
@azat azat deleted the s3-exists branch September 23, 2025 06:31
@robot-ch-test-poll2 robot-ch-test-poll2 added pr-synced-to-cloud The PR is synced to the cloud repo pr-backports-created-cloud deprecated label, NOOP pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR labels Sep 23, 2025
robot-clickhouse added a commit that referenced this pull request Sep 23, 2025
Cherry pick #87426 to 25.6: Ignore only not found errors for s3_plain_rewritable (and some other S3 code)
robot-clickhouse added a commit that referenced this pull request Sep 23, 2025
robot-clickhouse added a commit that referenced this pull request Sep 23, 2025
Cherry pick #87426 to 25.7: Ignore only not found errors for s3_plain_rewritable (and some other S3 code)
robot-clickhouse added a commit that referenced this pull request Sep 23, 2025
robot-clickhouse added a commit that referenced this pull request Sep 23, 2025
Cherry pick #87426 to 25.8: Ignore only not found errors for s3_plain_rewritable (and some other S3 code)
robot-clickhouse added a commit that referenced this pull request Sep 23, 2025
robot-clickhouse added a commit that referenced this pull request Sep 23, 2025
Cherry pick #87426 to 25.9: Ignore only not found errors for s3_plain_rewritable (and some other S3 code)
robot-clickhouse added a commit that referenced this pull request Sep 23, 2025
clickhouse-gh bot added a commit that referenced this pull request Sep 23, 2025
Backport #87426 to 25.7: Ignore only not found errors for s3_plain_rewritable (and some other S3 code)
clickhouse-gh bot added a commit that referenced this pull request Sep 23, 2025
Backport #87426 to 25.6: Ignore only not found errors for s3_plain_rewritable (and some other S3 code)
azat added a commit that referenced this pull request Sep 23, 2025
Backport #87426 to 25.8: Ignore only not found errors for s3_plain_rewritable (and some other S3 code)
azat added a commit that referenced this pull request Sep 23, 2025
Backport #87426 to 25.9: Ignore only not found errors for s3_plain_rewritable (and some other S3 code)
robot-ch-test-poll added a commit that referenced this pull request Sep 23, 2025
Cherry pick #87426 to 25.3: Ignore only not found errors for s3_plain_rewritable (and some other S3 code)
robot-clickhouse added a commit that referenced this pull request Sep 23, 2025
azat added a commit that referenced this pull request Sep 23, 2025
…25.9/87449

* u/backport/25.9/87449:
  Backport #87426 to 25.9: Ignore only not found errors for s3_plain_rewritable (and some other S3 code)
  Backport #87231 to 25.9: Fix "Too large size passed to allocator" UB in JOIN due to mixed const and non-const blocks
  Backport #87198 to 25.9: Disable the setting by default
  Backport #87392 to 25.9: Fix EmbeddedRocksDB upgrade
  Backport #87140 to 25.9: fix: fix server level max temporary size limit
  Backport #87178 to 25.9: PR: fix LEFT/INNER ... RIGHT ... JOINS chain
  Update autogenerated version to 25.10.1.1 and contributors
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Sep 23, 2025
@azat
Copy link
Copy Markdown
Member Author

azat commented Sep 23, 2025

And a follow-up to fix the interface - #87485

azat added a commit that referenced this pull request Sep 23, 2025
Backport #87426 to 25.3: Ignore only not found errors for s3_plain_rewritable (and some other S3 code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-backports-created-cloud deprecated label, NOOP pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR 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.

5 participants