N624-debu opened a new pull request, #14900:
URL: https://github.com/apache/lucene/pull/14900

   # [Draft] SharedMergeScheduler using shared thread pool for multi-tenant 
merge scheduling
   
   This draft PR introduces a prototype `SharedMergeScheduler`, which extends 
`MergeScheduler` and routes all merge tasks through a shared thread pool across 
`IndexWriter` instances.
   
   ## Motivation
   
   In multi-tenant environments (e.g., Solr, Elasticsearch), many 
`IndexWriter`s may coexist in the same JVM. The default Lucene behavior assigns 
each writer its own `ConcurrentMergeScheduler` and thread pool, which can lead 
to resource oversubscription and inefficient coordination.
   
   This implementation introduces a new merge scheduler that centralizes merge 
execution via a shared thread pool. This idea builds on feedback from [GitHub 
issue #13883](https://github.com/apache/lucene/issues/13883), where 
contributors suggested exploring a dedicated scheduler based on Java's executor 
framework, rather than modifying the existing `ConcurrentMergeScheduler`.
   
   ## Implementation Highlights
   
   - Adds a new class `SharedMergeScheduler` in `lucene.index`
   - Implements the `merge(MergeSource, MergeTrigger)` method using the public 
`MergeSource` API
   - Uses a static `Executors.newFixedThreadPool(4)` as a prototype shared 
executor
   - Keeps `ConcurrentMergeScheduler` unchanged for easier evaluation and 
iteration
   
   ## Next Steps
   
   - Add lifecycle management and graceful shutdown to the executor
   - Evaluate fairness or throttling strategies across writers
   - Potentially combine with a centralized merge manager
   - Seek feedback on architecture fit and maintainability
   
   ---
   
   This PR is opened to propose and evaluate a shared-thread-pool merge 
scheduler design, and to gather feedback for further development.
   
   


-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to