yujun777 commented on code in PR #68648:
URL: https://github.com/apache/doris/pull/68648#discussion_r4141441274


##########
regression-test/suites/mtmv_p0/test_mtmv_base_partition_read_scope.groovy:
##########
@@ -0,0 +1,107 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_mtmv_base_partition_read_scope") {
+    // A refresh reads the base partitions the MV partition is recorded with, 
and no others. The window of
+    // partition_sync_limit below keeps the last two days, so the day before 
them is recorded nowhere: it
+    // must not be read either, or its rows would sit in the MV partition -- 
whose key range does cover
+    // them -- while the snapshot says the MV does not hold that partition. A 
base partition dropped after
+    // such a read would then be invisible to the sync check, and the 
transparent rewrite would serve the
+    // rows of a partition the base table no longer has.
+    //
+    // The MV partition is a year and the base table's are days, so the range 
it is read through is wider
+    // than what it is recorded with. Days are taken relative to today, and 
the two sides are asserted
+    // separately rather than as a total, so that where the window's edge 
falls does not decide the case.
+    def today = java.time.LocalDate.now()
+    def expiredDay = today.minusDays(5)
+    def keptDay = today.minusDays(1)
+    // The expired day is read by a refresh only while it falls inside a 
retained MV partition's range, and
+    // both days are inside the same year only from the third of January on. 
Skipped rather than asserted
+    // when they are not, so that a run that exercises the case is a run that 
can fail without the change.
+    org.junit.Assume.assumeTrue("the expired day and today are in the same 
year",

Review Comment:
   Fixed in 5bf185b273d. You are right about the runner: `SuiteContext#start` 
catches every `Throwable` from the suite body and records it through 
`onSuiteFailed`, so the assumption was a failure of the whole suite -- and 
being at the top of it, it took the calendar independent cases down with it for 
five days a year.
   
   The calendar dependent part is now guarded by a condition, so it is the part 
that is left out rather than the suite, and the rest runs either way (verified 
by forcing the guard off: the same suite passes with the other cases alone). 
The days themselves stay relative because what the case is about -- a base 
partition the sync window left out, inside a retained MV partition's range -- 
cannot be written with fixed dates; the fixed-date shapes that can be are the 
list partition cases, which are calendar independent and always run.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to