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

   ## What changes were proposed in this pull request?
   
   FullTable Cache eviction is used for cleanup entry in cache if its value is 
null and same is persisted in DB. Current logic keeps and iterate all epoch for 
updatation.
   
   As Optimization having logic refactor:
   - keep epochEntries only for case where key is deleted (i.e. value is null 
as marked for deletion)
   - lock is put is required to be readonly, as protection is required while 
cleanup of cache entry (which is not threadsafe) wrt put logic. Its safe to 
have parallel put.
   `1. Cleanup Policy Never uses ConcurrentSkipListMap, and its 
computeIfPresent is not atomic, so there can be a race condition between 
cleanup and requests adding to cache. (This might cause cleaning up entries 
which are not flushed to DB, and this can cause correctness issue)
   `
   Reference: [HDDS-4583](https://issues.apache.org/jira/browse/HDDS-4583)
   
   - lock is moved to higher level outside loop of epochEntries, to avoid 
multiple write lock-unlock, and its memory operation, so loop logic will be 
very fast, and reduce lock contention.
   - scheduler is changed to timer based to avoid keep adding new entry in 
worker. Also need only recent epoch to clear old epoch in eviction for 
epochEntries, as its not mandatory to have all epoch in order for cleanup.
   
   As above changes, 
   - it will avoid entries for new and modified key-values. Only for delete 
case. Since delete is very less for volume and bucket, this will avoid cleanup 
for epochs.
   - If there is lock starvation for cleanup, workers queue in scheduler will 
not increase and will be consistent to have minimum memory usages.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-11201
   
   ## How was this patch tested?
   
   - test case updated covering changes
   


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