jerryshao commented on code in PR #5728:
URL: https://github.com/apache/gravitino/pull/5728#discussion_r1879260947
##########
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:
I think typically it will not have the concurrent updates problem for a
single server Gravitino, looks like it only happens when we have multiple
Gravitino instances. I think using `update...set...where` may not really solve
the problem, a possible solution is to use transactions to handle this problem.
--
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]