F64116045 opened a new pull request, #11748:
URL: https://github.com/apache/ozone/pull/11748

   ## What changes were proposed in this pull request?
   
   SCM limits how many blocks each datanode receives in one block deletion 
interval. 
   Before selecting a transaction, it checks how many blocks have already been 
assigned to every replica's datanode.
   
   The current check scans and sums all transactions already selected for the 
datanode.
   Repeating this scan before selecting each new transaction results in O(n²) 
total counting work.
   
   This change maintains the block count when a transaction is added. 
   Each check then takes O(1), reducing the counting work to O(n).
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17449
   
   ## How was this patch tested?
   
   The benchmark simulates the per-datanode limit check while selecting 10,000 
transactions for one datanode. 
   For each transaction, it reads the current block count and then adds a 
transaction containing one block.
   
   | Version | Measurements (ms) | Median |
   |---|---|---:|
   | Before | 182.275, 154.096, 126.175, 115.677, 164.221, 96.323, 91.092 | 
126.175 ms |
   | After | 4.539, 2.674, 2.099, 1.751, 1.545, 1.662, 1.218 | 1.751 ms |
   
   CI:


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