Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow max_table_size_to_drop and max_partition_size_to_drop setting per query #44715

Closed
alrocar opened this issue Dec 29, 2022 · 2 comments
Closed

Comments

@alrocar
Copy link

alrocar commented Dec 29, 2022

It'd be nice if we could do this:

alter table ddrop detach partition tuple() settings max_partition_size_to_drop=<value>

or

drop table ddrop settings max_table_size_to_drop=<value>

Right now to overcome the global limits set in config.xml there's a workaround to set a flag in the file system:

Received exception from server (version 22.9.1):
Code: 359. DB::Exception: Received from 127.0.0.1:9001. DB::Exception: Table or Partition in default.ddrop was not dropped.
Reason:
1. Size (4.01 MB) is greater than max_[table/partition]_size_to_drop (1.00 B)
2. File '/Users/alrocar/ch/111/flags/force_drop_table' intended to force DROP doesn't exist
How to fix this:
1. Either increase (or set to zero) max_[table/partition]_size_to_drop in server config
2. Either create forcing file /Users/alrocar/ch/111/flags/force_drop_table and make sure that ClickHouse has write permission for it.
Example:
sudo touch '/Users/alrocar/ch/111/flags/force_drop_table' && sudo chmod 666 '/Users/alrocar/ch/111/flags/force_drop_table'. (TABLE_SIZE_EXCEEDS_MAX_DROP_SIZE_LIMIT)

But they require access to the file system + it might have side effects to other drop queries while enabled.

@den-crane
Copy link
Contributor

max_partition_size_to_drop / max_table_size_to_drop are implemented to secure data from accidental / malicious removal using SQL.

@alrocar
Copy link
Author

alrocar commented Dec 20, 2023

#57452

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

No branches or pull requests

2 participants