ChrisHegarty commented on PR #16883:
URL: https://github.com/apache/lucene/pull/16883#issuecomment-6361381668

   I have a design question on `readAdvice` in `MemorySegmentIndexInput` and 
`isEfficientFor`.
   
   `updateIOContext` calls madvise on the shared pages, so it affects the 
parent and its clones and slices. But `readAdvice` is a per-instance field. 
Clones and slices copy it when they're created, and `updateIOContext` only 
updates the instance it's called on.
   
   So, is the intent that the advice belongs to the parent, and clones and 
slices defer to it? Or is it per instance, with each copy reporting what it was 
created with? Right now it's the second, but the pages behave like the first.
   
   This matters for `updateIOContext`. After updateIOContext on the parent, 
existing clones and slices keep reporting the old advice. Similarly, after 
`updateIOContext` on a clone or slice, the parent keeps reporting the old 
advice, even though the pages changed.
   
   Related to that, `readAdvice` is a plain non-volatile field. 
`updateIOContext `can write it while another thread reads it in 
`isEfficientFor`. 


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