gavinchou opened a new pull request, #65670:
URL: https://github.com/apache/doris/pull/65670

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: #65665
   
   Problem Summary:
   
   `ALTER RESOURCE` mutates the live `Resource` object in place while `SHOW 
RESOURCE`, checkpoint image serialization, and batch edit-log flush can read it 
asynchronously. For HDFS resources, property-map iteration could race with 
mutation, and a later ALTER could change the object serialized for an earlier 
journal entry.
   
   This change protects HDFS property mutation and reads with the resource 
read/write lock. It serializes resource state under a stable lock order, 
enqueues a detached ALTER snapshot while holding a per-resource ALTER lock, 
waits for journal completion after releasing that lock, and persists detached 
resource snapshots in checkpoint images.
   
   Compared with #65665, this keeps the existing `Resource.clone()` deep-copy 
behavior and narrows Gson deserialization to after serialization locks have 
been released.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test:
       - Unit Test: isolated `JUnitCore` run for `ResourceMgrTest` and 
`ResourcePersistTest` (10 tests passed)
       - `mvn -pl fe-core -am validate -Dskip.doc=true` passed
       - `git diff --check` passed
       - `sh run-fe-ut.sh --run org.apache.doris.catalog.ResourceMgrTest` was 
blocked by an existing master `testCompile` error in `SchemaChangeHandlerTest`: 
missing `Column.BINLOG_TIMESTAMP_COL`
       - `sh build.sh --fe` was blocked by the same existing `testCompile` 
error after FE main compilation and checkstyle passed
   - Behavior changed: Yes, concurrent resource reads and persistence now 
observe stable snapshots
   - Does this need documentation: No


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