-
Notifications
You must be signed in to change notification settings - Fork 469
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
Dropping a replica does not drop the table and leaves data in zookeeper #735
Comments
Follow up: After following the steps above, when I delete the CHI entirely (with only replica 0 left), I see these logs:
So it appears the operator does delete the tables, but only when the entire CHI is deleted. Unfortunately, this means the first replica data is leaked in zookeeper, even after the CHI is deleted. When I use the zkCli, I can still see the replica 1 data remains, since it was not deleted when the replica was removed: [zk: localhost:2181(CONNECTED) 19] ls /clickhouse/tables/0/test_scaling/replicas
[chi-testlocal-local-0-1] |
This is weird. We have a dedicated test that checks zookeeper contents and it passed. I now looked into the test carefully and found that the test had a bug. So thanks for the catch! Looks like it has been broken in 0.14, it works correctly before then. Btw, in 0.15.0 version we changed the logic -- it now uses SYSTEM DROP REPLICA instead of DROP TABLE. |
Interesting, not a problem! Thanks for confirming it was actually an issue. Feel free to close this then if it's already fixed in the next version. |
Fixed in 0.15.0, tested in clickhouse-operator/tests/test_operator.py Line 748 in 0927fe5
|
Hi operator team,
I am using the
0.14.0
version of the operator and noticing it does not drop replicated tables when removing replicas. Here is my CHI definition (installed zookeeper separately):After standing up the cluster, I create a replicated table on all replicas with:
I then insert some data into the tables with:
And finally, I decrease the CHI
spec.configuration.clusters[0].layout.replicasCount
to 1, and reapply. After the replica is gone, I can still see the ZK data with:And I see:
When running the operator locally, this code to drop the replica is never executed:
clickhouse-operator/pkg/model/schemer.go
Line 301 in 581cf31
I believe older version of the operator used to explicitly drop replicated tables before deleting the hosts. Is this possibly an issue with the latest version of the operator or something I may have mis-configured?
Thanks!
The text was updated successfully, but these errors were encountered: