Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-17149: Fix backup/restore for large collections. #2243

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion solr/core/src/java/org/apache/solr/core/CoreContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,8 @@ public CoreContainer(NodeConfig config, CoresLocator locator, boolean asyncSolrC
new OrderedExecutor(
cfg.getReplayUpdatesThreads(),
ExecutorUtil.newMDCAwareCachedThreadPool(
psalagnac marked this conversation as resolved.
Show resolved Hide resolved
cfg.getReplayUpdatesThreads(),
cfg.getReplayUpdatesThreads(), // thread count
cfg.getReplayUpdatesThreads(), // queue size
new SolrNamedThreadFactory("replayUpdatesExecutor")));
this.appHandlersByConfigSetId = new JerseyAppHandlerCache();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,9 @@ public static class CoreAdminAsyncTracker {
// We keep the number number of max threads very low to have throttling for expensive tasks
private ExecutorService expensiveExecutor =
ExecutorUtil.newMDCAwareCachedThreadPool(
5, new SolrNamedThreadFactory("parallelCoreAdminAPIExpensiveExecutor"));
5,
Integer.MAX_VALUE,
new SolrNamedThreadFactory("parallelCoreAdminAPIExpensiveExecutor"));

public CoreAdminAsyncTracker() {
HashMap<String, Map<String, TaskObject>> map = new HashMap<>(3, 1.0f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,14 @@ public static ExecutorService newMDCAwareCachedThreadPool(ThreadFactory threadFa
}

public static ExecutorService newMDCAwareCachedThreadPool(
int maxThreads, ThreadFactory threadFactory) {
int maxThreads, int queueCapacity, ThreadFactory threadFactory) {
return new MDCAwareThreadPoolExecutor(
0, maxThreads, 60L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(maxThreads), threadFactory);
0,
maxThreads,
60L,
TimeUnit.SECONDS,
new LinkedBlockingQueue<>(queueCapacity),
threadFactory);
}

@SuppressForbidden(reason = "class customizes ThreadPoolExecutor so it can be used instead")
Expand Down