Commit 40b5efe
[BugFix] Key MV pinned-range map by Table#getUUID() so it is cross-database-unique
The pinned-range map is keyed by a table identifier that producers
(setupPinnedRangesIfNeeded) and consumers (MVPCTRefreshPlanBuilder,
PartitionDiffer#pinnedRangeFor) both compute. Using Table#getTableIdentifier()
keys native tables by their bare name, which is not unique across databases: an
MV referencing two same-named tables in different databases overwrites one
entry, so one table's pinned snapshot is lost.
Key the map by Table#getUUID() on both sides instead — it is cross-database-unique
for every table kind (the table id for native/cloud-native, catalog.db.table.uuid
for external) and is identical at producer and every consumer.
IcebergTable#getUUID() also gains an instanceof-BaseTable guard so a non-BaseTable
native table degrades to an empty uuid instead of a ClassCastException, matching
getTableIdentifier().
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Youngwb <yangwenbo_mailbox@163.com>1 parent c613e0f commit 40b5efe
4 files changed
Lines changed: 11 additions & 9 deletions
File tree
- fe/fe-core/src/main/java/com/starrocks
- catalog
- scheduler/mv
- pct
- sql/common
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
177 | 179 | | |
178 | 180 | | |
179 | 181 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
0 commit comments