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


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/ResourceMgr.java:
##########
@@ -235,6 +243,16 @@ public void write(DataOutput out) throws IOException {
         Text.writeString(out, json);
     }
 
+    private Resource getAlterLogResource(Resource resource) {
+        try {
+            return resource.getCopiedResourceSnapshot();
+        } catch (Throwable t) {

Review Comment:
   This detached snapshot fixes the ALTER journal payload, but live image 
serialization is still left on the old live-object path. For example, `/dump` 
calls `Env.dumpImage()` on the serving Env, and `saveResources()` still reaches 
`ResourceMgr.write()`, which writes `GsonUtils.GSON.toJson(this)`. That 
reflective Gson traversal walks the live `nameToResource` map and each 
`Resource` field directly; it does not call the HDFS `getCopiedProperties()` 
method that now takes the read lock. A concurrent `ALTER RESOURCE` can 
therefore still mutate an HDFS resource's `properties` map under 
`HdfsResource.modifyProperties()` while a live image dump is traversing the 
same map. Please use detached resource snapshots for image writing as well, or 
otherwise take the same per-resource read/reference locks before serializing 
live resources.



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