JohannesLichtenberger commented on pull request #518:
URL: https://github.com/apache/lucene/pull/518#issuecomment-1084586608


   So, if the writer adds something to the lucene index (not via mmap) new 
index readers will create a new `IndexInput` with new mapped memory segments 
plus clones with the same segments for different threads, right? Isn't it a 
valid use case here to have multiple index readers or is it supposed to close 
the index reader and the clones first?
   
   In my case (SirixDB) you're supposed to create multiple read-only 
transactions bound to a specific trx if you like to use different threads for 
instance (currently I've shared a memory segment). However the writer appends 
to the data file and a new read-only trx thus has to get a new map of the file 
(to read the most recently committed revision). Thus, either a new memory 
segment must be set and even set for all readers guarded with a Semaphore for 
instance or I'll have to use multiple memory segments, but I guess that's a bad 
approach.
   
   Either way it would be similar (multiple readers and a single writer which 
only ever appends data). In your case you're cloning the IndexInput and append 
to the data file(s) without a memory mapping. However, it's not clear to me if 
it's a valid use case for lucene to have multiple index readers, but you 
suggest that it's not the approach to use. But how do you make sure that new 
index readers (cloned or not) will see all the 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