Skip to content

"Directory for table data already exists" after attempt to create replicated table with invalid zk path #14115

@Alex-Burmak

Description

@Alex-Burmak

Attempt to create replicated table with invalid zk path leads to empty table data dir on file system, and subsequent attempts results to "Directory for table data already exists" errors.

ClickHouse version: 20.6.4

Steps to reproduce

sas-644d9zs4v9adt4ka.db.yandex.net :) create table test (date Date, n UInt32) ENGINE = ReplicatedMergeTree('/{invalid}/table', '{replica}') PARTITION BY date ORDER BY (date, n)

CREATE TABLE test
(
    `date` Date,
    `n` UInt32
)
ENGINE = ReplicatedMergeTree('/{invalid}/table', '{replica}')
PARTITION BY date
ORDER BY (date, n)


Received exception from server (version 20.6.4):
Code: 62. DB::Exception: Received from localhost:9001. DB::Exception: No macro 'invalid' in config while processing substitutions in '/{invalid}/table' at 2.

0 rows in set. Elapsed: 0.020 sec.

sas-644d9zs4v9adt4ka.db.yandex.net :) create table test (date Date, n UInt32) ENGINE = ReplicatedMergeTree('/table', '{replica}') PARTITION BY date ORDER BY (date, n)

CREATE TABLE test
(
    `date` Date,
    `n` UInt32
)
ENGINE = ReplicatedMergeTree('/table', '{replica}')
PARTITION BY date
ORDER BY (date, n)


Received exception from server (version 20.6.4):
Code: 57. DB::Exception: Received from localhost:9001. DB::Exception: Directory for table data data/default/test/ already exists.

0 rows in set. Elapsed: 0.011 sec.

Similar issue: #11432

Metadata

Metadata

Assignees

Labels

bugConfirmed user-visible misbehaviour in official releasecomp-replicationReplicatedMergeTree* + replication log/state transitions, eventual consistency mechanics.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions