d-wang-commit opened a new pull request, #18902:
URL: https://github.com/apache/iotdb/pull/18902

   ## Description
   
   Reduce copying in ConfigNode region maintenance by locating the database and 
target Region before copying its replica set. With D databases, N Regions and R 
replicas per Region, lookup and copying decrease from O(D + N × R) to O(D + R), 
assuming average constant-time hash lookups.
   
   Filter replica node IDs before copying node configurations, and query the 
leader cache directly instead of building the full leader map, reducing a 
single leader lookup from O(N) to O(1).
   
   ### Tests
   
   - Added/updated `RegionReplicaSetLookupTest`, `RegionMaintainHandlerTest`, 
and `ConsensusGroupCacheTest`; all 58 related UTs passed.
   - No IT changes included. Local 1C3D multi-database Region expansion/shrink 
validation passed.
   - English reactor verification, Chinese-locale packaging, and Spotless 
passed.
   
   ### Side effects and risks
   
   ConfigNode-only changes; deep-copy and leader-election waiting behavior are 
retained. Candidate configurations now use individual read locks, so concurrent 
updates may be observed between candidate reads. No RPC or persistence format 
changes.
   
   <hr>
   
   This PR has:
   
   - [x] been self-reviewed.
   - [x] been tested in a test IoTDB cluster.
   
   <hr>
   
   ##### Key changed/added classes (or packages if there are too many classes) 
in this PR
   
   `RegionMaintainHandler`, `PartitionInfo`, `LoadManager`, `LoadCache`, and 
related unit tests.
   


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