-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
CH replicas always fetch partition with ATTACH PARTITION #5312
Comments
workaround https://t.me/clickhouse_ru/81231 |
I believe we might be seeing this issue when restoring from backups. Is there any plan to address it? Also, Google Translate is not working well for the workaround. Would someone mind translating it for us please? |
It's a documentation issue. ATTACH PARTITION works as designed. I am not sure that workaround is working.
Though maybe it working. No fetch part.
|
Good to know! Thanks for sharing! |
Fix for alter attach alter_attach-partition (fixes ClickHouse#5312)
Fix for alter attach alter_attach-partition (fixes ClickHouse#5312). English version.
https://clickhouse.yandex/docs/en/query_language/alter/#alter_attach-partition
Documentation states: This query is replicated.
Each replica checks whether there is data in the detached directory.
If the data is in this directory, the query checks the integrity, verifies that it matches the
data on the server that initiated the query. If everything is correct, the query adds data
to the replica. If not, it downloads data from the query requestor replica, or from another replica where the data has already been added.
This is either a documentation bug or a server bug.
create table XXXX on cluster XXXX (A Int64)
ENGINE = ReplicatedMergeTree ('/clickhouse/{cluster}/tables/XXXX','{replica}')
order by tuple();
insert into XXXX values(1);
alter table XXXX detach partition tuple();
ls -1 /var/lib/clickhouse/data/dw/XXXX/detached/
all_0_0_0
alter table XXXX attach partition tuple();
ls -1 /var/lib/clickhouse/data/dw/XXXX/
all_2_2_0
REPLICA
ls -1 /var/lib/clickhouse/data/dw/XXXX/detached/
all_0_0_0
grep XXXX /var/log/clickhouse-server/clickhouse-server.log
The text was updated successfully, but these errors were encountered: