xloya commented on code in PR #5728:
URL: https://github.com/apache/gravitino/pull/5728#discussion_r1879418179


##########
core/src/main/java/org/apache/gravitino/storage/relational/mapper/provider/base/ModelMetaBaseSQLProvider.java:
##########
@@ -134,4 +134,11 @@ public String deleteModelMetasByLegacyTimeline(
         + ModelMetaMapper.TABLE_NAME
         + " WHERE deleted_at > 0 AND deleted_at < #{legacyTimeline} LIMIT 
#{limit}";
   }
+
+  public String updateModelLatestVersion(@Param("modelId") Long modelId) {
+    return "UPDATE "
+        + ModelMetaMapper.TABLE_NAME
+        + " SET model_latest_version = model_latest_version + 1"
+        + " WHERE model_id = #{modelId} AND deleted_at = 0";

Review Comment:
   Yeah, I think a single instance based on local lock can solve this problem, 
but our internal production environment is multi-instance load balancing, and 
updating without specifying the version may be a potential problem for our 
scenario. In particular, this SQL will provide an independent method, which may 
be a potential risk if used in some custom development. WDYT?



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

Reply via email to