errose28 commented on PR #7550:
URL: https://github.com/apache/ozone/pull/7550#issuecomment-2842779816

   Thanks for working on this @tanvipenumudy. I have some suggestions for 
managing the changes:
   - Let's leave HDDS-11894 as the top level jira for tracking this feature 
with no code changes attached to it. That way we can resolve Jiras as their PRs 
get merged.
   - Let's migrate the google doc attached to that Jira to a markdown PR and 
use the Jira HDDS-11894 for that instead.
   
   I have some suggestions on the design that I'll outline here, but it would 
be better to discuss these in a doc PR:
   
   The cache eviction logic in the current implementation makes sense to me, 
but I'm not sure about the cache population logic. This implementation has 
multiple threads trying to populate the cache, which makes coordination 
difficult since we must control how many blocks each one can fetch to not 
exceed the cache limit. Additional complexity comes from these cache population 
threads being the same as the request threads, so the number of threads and 
when they get invoked is determined by the foreground load. 
   
   I do think the current implementation is an improvement over a timer based 
background approach, because we will not be churning blocks in an idle cluster. 
My proposal is for something that is in between these two implementations:
   - There is only one dedicated thread that populates the block cache
   - This thread is triggered to populate the cache when:
     - A request comes in and asks for blocks AND
     - The number of blocks left in the cache after the request takes what it 
needs is less than a configured theshold.
   - Requests will not wait on the background thread, even if that request 
triggered cache population. If there are not enough blocks in the cache, the 
request will go directly to SCM and fetch only the blocks it needs for that 
request.
   - While the cache population thread is working, requests will continue to go 
directly to SCM until it finishes, without triggering more cache population 
requests.


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