benwtrent commented on code in PR #13190:
URL: https://github.com/apache/lucene/pull/13190#discussion_r1531011510
##########
lucene/core/src/java/org/apache/lucene/index/MergePolicy.java:
##########
@@ -136,13 +136,13 @@ public boolean isAborted() {
*/
public void pauseNanos(long pauseNanos, PauseReason reason,
BooleanSupplier condition)
throws InterruptedException {
- if (Thread.currentThread() != owner) {
+ /* if (Thread.currentThread() != owner) {
throw new RuntimeException(
"Only the merge owner thread can call pauseNanos(). This thread: "
+ Thread.currentThread().getName()
+ ", owner thread: "
+ owner);
- }
+ }*/
Review Comment:
> I guess not, but now we need to make sure that the rate is applied across
all threads rather than per-thread?
Looking at the code, it seems like it was previously assumed that only one
`createOutput` was called at a time for a merge. Now, it could be that more
than one is called.
I guess this means we need a `RateLimitingDirectory` that passes things in
to the `RateLimitedIndexOutput` ensure global rate limiting is controlled
across all outputs. Is this what you are talking about?
I am not sure that `pauseNanos` should directly know about other threads and
pause them. It seems better to put this up on the directory level.
--
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]