You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug or unexpected behaviour
Rename query on Distributed table does not rename data directory. All data will be putted to old directory which lead to some side effects.
How to reproduce
Which ClickHouse server version to use
19.16.4.12
CREATETABLEstaging.test_shard ON CLUSTER cluster_name
(
id String,
sid String
)
ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/staging/test_shard', '{replica}')
PARTITION BY tuple()
ORDER BY (id);
CREATETABLEstaging.test_new ON CLUSTER cluster_name
ASstaging.test_shard
ENGINE = Distributed(cluster_name, staging, test_shard, rand());
RENAME TABLE staging.test_new TO staging.testON CLUSTER cluster_name;
insert into test (id) values ('1');
ALTERTABLEstaging.test_shardON CLUSTER cluster_name
DROP COLUMN sid;
ALTERTABLEstaging.test_shardON CLUSTER cluster_name
ADD COLUMN sid MATERIALIZED id;
-- need to trigger temporary storage in distributed tableinsert into test (id) values ('2');
insert into test (id) values ('3');
-- we usually use this queries to atomic replace distributed table on whole cluster-- with same structure as shardCREATETABLEstaging.test_new ON CLUSTER cluster_name
ASstaging.test_shard
ENGINE = Distributed(cluster_name, staging, test_shard, rand());
RENAME TABLE staging.test TO staging.test_old, staging.test_new TO staging.testON CLUSTER cluster_name;
selectcount(*) fromstaging.testinsert into test (id) values ('4');
insert into test (id) values ('5');
selectcount(*) fromstaging.testDROPTABLEstaging.test_oldON CLUSTER cluster_name;
After this:
in data directory: test_new exists; test does not exists.
No new data in table test_shard.
Only restart solve situation.
Expected behavior
Data directory should be renamed. All tem
(you don't have to strictly follow this form)
Describe the bug or unexpected behaviour
Rename query on Distributed table does not rename data directory. All data will be putted to old directory which lead to some side effects.
How to reproduce
19.16.4.12
After this:
in data directory:
test_new
exists;test
does not exists.No new data in table
test_shard
.Only restart solve situation.
Expected behavior
Data directory should be renamed. All tem
Error message and/or stacktrace
The text was updated successfully, but these errors were encountered: