Commit b7f843c
committed
Fix double-distributed query
Use local offsets table in BatchFinder CTE to avoid double-distributed
query error (ClickHouse error 288). The BatchFinder queries
access_logs_federated (distributed table), which executes on each shard.
Each shard should read its local offsets table rather than querying
offsets_federated, which would create a distributed query within a
distributed query.
Both tables are sharded by raftSessionID, so data is co-located and
each shard has the offsets it needs locally. CommitOffset and GetOffset
continue to use offsets_federated for proper cross-shard routing.1 parent 5462c1f commit b7f843c
2 files changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
0 commit comments