Copilot commented on code in PR #59771:
URL: https://github.com/apache/doris/pull/59771#discussion_r2681347527


##########
fe/fe-core/src/main/java/org/apache/doris/persist/gson/GsonUtils.java:
##########
@@ -528,7 +528,8 @@ public class GsonUtils {
             .of(Replica.class, "clazz")
             .registerDefaultSubtype(Replica.class)
             .registerSubtype(Replica.class, Replica.class.getSimpleName())
-            .registerSubtype(CloudReplica.class, 
CloudReplica.class.getSimpleName());
+            .registerSubtype(CloudReplica.class, 
CloudReplica.class.getSimpleName())
+            .registerCompatibleSubtype(Replica.class, "LocalReplica");

Review Comment:
   The LocalReplica compatibility registration is placed outside of any 
conditional block, which is inconsistent with the LocalTablet pattern (line 
543) and existing patterns in this file (see alterJobV2TypeAdapterFactory and 
dsTypeAdapterFactory). 
   
   Since LocalReplica and LocalTablet are introduced in the same context for 
non-cloud mode, the LocalReplica compatibility registration should also be 
conditional on Config.isNotCloudMode(). This ensures that the compatibility 
mapping is only registered when needed for non-cloud mode downgrade scenarios.
   
   Consider moving this registration into a static block similar to 
tabletTypeAdapterFactory, with the registerCompatibleSubtype call inside the 
Config.isNotCloudMode() condition.



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