ClickHouse / ClickHouse/ClickHouse

deduplication_path for attach/replace should include src table name

Open
#105,632 1 comment 0 reactions 0 assignees View on GitHub
clickgap-analyzed comp-replication culprit-pr-not-found external unexpected behaviour
Dominant language
C++
Stars
49.9k
Forks
9k
Avg merge
21h 32m
Merged PRs (30d)
515

Description

### Company or project name

_No response_

### Describe the unexpected behaviour

https://github.com/ClickHouse/ClickHouse/blob/131ef1d5bc85e8abff29a1fda82ed59ab398615a/src/Storages/StorageReplicatedMergeTree.cpp#L9065

```
2026.05.15 12:07:30.438526 [ 32 ] {} createEphemeralLockInZooKeeper: Deduplication path already exists: deduplication_path=/clickhouse/tables/dest_table_uuid/0/blocks/[partition_id]_replace_from_[part_checksum_hash]
```

Dedup hash should include SRC table uuid/name

### Which ClickHouse versions are affected?

All

### How to reproduce

1. Attach part with the same data from one table
2. Attach part with the same data from another table

Second attach is deduplicated, despite it different statement and therefore no sense to have it deduplicated.

### Expected behavior

_No response_

### Error message and/or stacktrace

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.