github-actions[bot] commented on code in PR #66255:
URL: https://github.com/apache/doris/pull/66255#discussion_r3710182219


##########
fe/fe-core/src/test/java/org/apache/doris/persist/TruncateTableInfoTest.java:
##########
@@ -0,0 +1,46 @@
+// 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.
+
+package org.apache.doris.persist;
+
+import org.apache.doris.persist.gson.GsonUtils;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+class TruncateTableInfoTest {
+    @Test
+    void testVersionSerialization() {
+        TruncateTableInfo info = new TruncateTableInfo(1L, "db", 2L, "tbl", 
Lists.newArrayList(),

Review Comment:
   [P2] Exercise both replay branches here
   
   These tests only prove that Gson preserves the two scalar fields and 
defaults them to zero. They still pass if `replayTruncateTable()` ignores/swaps 
the persisted values or routes a legacy record through the wrong transition. 
Because failover correctness now depends on positive records installing the 
leader's exact version/time while records without the fields retain the 
historical reset, please build a realistic table/record and assert the 
partition replacement plus table version/time after replay for both cases.



-- 
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