Skip to content

Possibility to change S3 disk settings in runtime#23429

Merged
vdimir merged 12 commits intoClickHouse:masterfrom
Jokser:disk-s3-restart-possibility
May 1, 2021
Merged

Possibility to change S3 disk settings in runtime#23429
vdimir merged 12 commits intoClickHouse:masterfrom
Jokser:disk-s3-restart-possibility

Conversation

@Jokser
Copy link
Copy Markdown
Contributor

@Jokser Jokser commented Apr 21, 2021

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Possibility to change S3 disk settings in runtime via new SYSTEM RESTART DISK SQL command.

Detailed description / Documentation draft:
Introduced DiskRestartProxy that re-applies changed S3 disk settings in runtime.
Introduced SYSTEM RESTART DISK SQL command that invokes DiskRestartProxy->restart().
Reduced memory usage for WriteBufferFromS3 decorators (each decorator allocated own buffer in memory that was not actually used).
ReadBufferFromS3/WriteBufferFromS3 decorators code refactoring.

@robot-clickhouse robot-clickhouse added the pr-improvement Pull request with some product improvements label Apr 21, 2021
@vdimir vdimir self-assigned this Apr 26, 2021
friend class DiskDecorator;

/// Applies new settings for disk in runtime.
virtual void applyNewSettings(ContextConstPtr) { }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe throw 'not implemented' error by default to catch calling method on disks that does not support this it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay, makes sense

Comment on lines +1507 to +1512
s3_max_single_read_retries = new_settings.s3_max_single_read_retries;
s3_min_upload_part_size = new_settings.s3_min_upload_part_size;
s3_max_single_part_upload_size = new_settings.s3_max_single_part_upload_size;
min_bytes_for_seek = new_settings.min_bytes_for_seek;
send_metadata = new_settings.send_metadata;
list_object_keys_size = new_settings.list_object_keys_size;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we store DiskS3Settings in DiskS3 and replace this object at once? Now we have same logic of putting corresponding fields from DiskS3Settings to DiskS3 fields in constructor and in applyNewSettings, but we can manipulate with whole object.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay, makes sense.

Comment on lines +22 to +24
swap(*impl);
auto position = impl->getPosition();
swap(*impl);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see that this swap was in deleted code, but didn't get why we swap buffers

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Decorator buffers don't have own buffer in memory, so we need to 'steal' actual working buffer from impl, perform an operation and return buffer back.

@sevirov
Copy link
Copy Markdown
Contributor

sevirov commented Nov 19, 2021

Internal documentation ticket: DOCSUP-18488

@HeenaBansal2009
Copy link
Copy Markdown
Contributor

@sevirov , I was wondering for the documentation for this feature.
I will appreciate if you can share the link relate dot this feature and was delivered asn part of Internal documentation ticket: DOCSUP-18488.

Thanks!

@vdimir
Copy link
Copy Markdown
Member

vdimir commented Aug 18, 2022

@HeenaBansal2009 I'm afraid it wasn't finished and is abandoned. I suppose best way to understand how feature work is to read changes in integration test for this PR.

@HeenaBansal2009
Copy link
Copy Markdown
Contributor

Thanks @vdimir for response. However , I am just curious Since this feature was implemented for backup/restore metadata files from S3 ? If it is not production use and abandoned , How current backup/restore feature of CH are going to be affected .

I was searching for any backup restore documentation if available.

Thanks in advance.

@vdimir
Copy link
Copy Markdown
Member

vdimir commented Aug 22, 2022

@HeenaBansal2009 New backup/restore is not related to this (here is the PRs for new backup/restore). Not sure about docs for the new feature. @vitlibar maybe you can answer?

@HeenaBansal2009
Copy link
Copy Markdown
Contributor

@vdimir Its good to see that backup/restore support is planned for 2022. I did find docs in clickhouse documentation for backup/restore commands.

However , I wanted to know is these commands does online backup? OR backup command does freeze the table and take snapshot

@Slach
Copy link
Copy Markdown
Contributor

Slach commented Sep 7, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants