Repository navigation
Commit 892b20c
committed
[fix](ivm) Rebuild the whole MV when a change mixes windowed and unwindowed partitions
The conservative branch added for partition_sync_limit judged the change by whether the selection came
out empty, so a statement that touches a partition inside the window and one outside it at once slipped
through: the inside half filled the selection while the outside half contributed nothing, because the
window leaves it out of the mapping. Only the newer MV partition got the barrier, and the rows of the
outside half -- still sitting in the MV partition that read them -- were never rebuilt, with no
incremental delta to repair them if the window is widened later.
Key changes:
- Require the mapping to describe every changed base partition, not merely to select something: a name the windowed mapping leaves out cannot be told apart from a partition no MV partition reads, so the whole MV is rebuilt
- Keep that judgement behind the same partition_sync_limit guard: without a limit the mapping is complete, and a partition it leaves out really is one no MV partition reads
- Log the names the mapping did not describe, which is what makes such a change readable in the FE log
Unit Test:
- IvmBaselineRebuildTest.testChangeThatMixesInWindowAndOutOfWindowPartitionsRebuildsTheWholeMv truncates one partition inside the window and one outside it in a single statement (the assertion fails with the empty-selection check, which is what the earlier round added)1 parent 0f119ee commit 892b20c
2 files changed
Lines changed: 62 additions & 8 deletions
File tree
- fe/fe-core/src
- main/java/org/apache/doris/catalog
- test/java/org/apache/doris/mtmv/ivm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
818 | 818 | | |
819 | 819 | | |
820 | 820 | | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
821 | 824 | | |
822 | 825 | | |
823 | 826 | | |
824 | 827 | | |
825 | 828 | | |
826 | 829 | | |
| 830 | + | |
827 | 831 | | |
828 | 832 | | |
829 | 833 | | |
| |||
843 | 847 | | |
844 | 848 | | |
845 | 849 | | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
853 | 862 | | |
854 | 863 | | |
855 | | - | |
| 864 | + | |
| 865 | + | |
856 | 866 | | |
857 | 867 | | |
858 | 868 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
215 | 259 | | |
216 | 260 | | |
217 | 261 | | |
| |||
0 commit comments