Repository navigation
backups: use cloned storage client with overridden retry policy settings for native copy - #87660
Conversation
b5ecb5d to
283b6e6
Compare
| else | ||
| { | ||
| auto locked = it->second.disk_reported_client.lock(); | ||
| if (locked != disk_client) |
There was a problem hiding this comment.
Create a new client if the underlying pointer of disk->getS3StorageClient() has changed, e.g., as a result of disk->applyNewSettings.
There was a problem hiding this comment.
It is set initially when inserted is true. Then, if the stored client pointer (locked) equals the current client pointer in the object storage, no update is required, and the stored client will be reused.
There was a problem hiding this comment.
Sorry maybe i am missing something, why do we need disk_reported_client here?
There was a problem hiding this comment.
To be able to update the client if it was reset externally, for example, as a result of a settings update here: https://github.com/ClickHouse/ClickHouse/blob/master/src/Disks/ObjectStorages/S3/S3ObjectStorage.cpp#L509
disk_reported_client serves as a reference (hence, weak_ptr)
There was a problem hiding this comment.
Thanks, @SmitaRKulkarni. I'll add clarifying comments, as this place seems to be confusing.
47d6cc3 to
4706d7b
Compare
f987588 to
a34f46a
Compare
2a67f55 to
55eec65
Compare
4858a60 to
b36cd89
Compare
…ridden retry policy settings for native copy
Backport #87660 to 25.9: backups: use cloned storage client with overridden retry policy settings for native copy
…ridden retry policy settings for native copy
Backport #87660 to 25.8: backups: use cloned storage client with overridden retry policy settings for native copy
…ith overridden retry policy settings for native copy"
…ans to `cloneWithConfigurationOverride` passed the configuration of the client being cloned straight on, keeping its `retryStrategy`, the object the SDK retries with: `ClientFactory::create` is the only place that builds one, from `retry_strategy`, so overriding that field alone changed nothing. The clone now builds it, with the same cap on `backup_slow_all_threads_after_retryable_s3_error` as the factory. This is what makes the retries of a backup or a restore reach the client of a disk at all, so it also completes the override of #87660. `DataSourceDescription::sameKind` compares the endpoint, so a backup on another one sent the restore through the buffers of `BackupReaderDefault` instead of the native branch the fallback lives in. The tests put the backup on the endpoint of the disk, where the client of the destination is the one that uploads. The injected answer carries `SlowDown` as its code and `Slow Down.` as its message, and the message is what surfaces, as `test_checking_s3_blobs_paranoid` already records. The assertion matches that. The new disk is added to the expectation of `check_system_tables`, which asserts the exact number of disks. Co-Authored-By: Claude Opus 5 <[email protected]>
Backups use S3 client settings that differ from the settings of the disk client, for example, an increased number of retries and longer delays.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Use S3 storage client with backup-specific settings (for example, backup_slow_all_threads_after_retryable_s3_error) for server-side (native) copy to a backup destination. Make s3_slow_all_threads_after_retryable_error obsolete.
Documentation entry for user-facing changes