-
Notifications
You must be signed in to change notification settings - Fork 180
Implement one-batch lookahead for index enumerators #4345
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
Changes from 3 commits
320bf8e
8ea3372
08e40e6
e38b709
25b9ce5
a5a0fbf
d3f4c1b
7eb3a17
c5eb5a0
8b68539
be20f67
d3035f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,8 +5,9 @@ | |
|
|
||
| package org.opensearch.sql.plugin; | ||
|
|
||
| import static java.util.Collections.singletonList; | ||
| import static org.opensearch.sql.datasource.model.DataSourceMetadata.defaultOpenSearchDataSourceMetadata; | ||
| import static org.opensearch.sql.opensearch.executor.OpenSearchQueryManager.SQL_BACKGROUND_THREAD_POOL_NAME; | ||
| import static org.opensearch.sql.opensearch.executor.OpenSearchQueryManager.SQL_WORKER_THREAD_POOL_NAME; | ||
| import static org.opensearch.sql.spark.data.constants.SparkConstants.SPARK_REQUEST_BUFFER_INDEX_NAME; | ||
|
|
||
| import com.google.common.collect.ImmutableList; | ||
|
|
@@ -74,7 +75,6 @@ | |
| import org.opensearch.sql.datasources.transport.TransportPatchDataSourceAction; | ||
| import org.opensearch.sql.datasources.transport.TransportUpdateDataSourceAction; | ||
| import org.opensearch.sql.legacy.esdomain.LocalClusterState; | ||
| import org.opensearch.sql.legacy.executor.AsyncRestExecutor; | ||
| import org.opensearch.sql.legacy.metrics.Metrics; | ||
| import org.opensearch.sql.legacy.plugin.RestSqlAction; | ||
| import org.opensearch.sql.legacy.plugin.RestSqlStatsAction; | ||
|
|
@@ -277,13 +277,23 @@ public ScheduledJobParser getJobParser() { | |
|
|
||
| @Override | ||
| public List<ExecutorBuilder<?>> getExecutorBuilders(Settings settings) { | ||
| return singletonList( | ||
| // The worker pool is the primary pool where most of the work is done. The background thread | ||
| // pool is a separate queue for asynchronous requests to other nodes. We keep them separate to | ||
| // prevent deadlocks during async fetches on small node counts. Tasks in the background pool | ||
| // should do no work except I/O to other services. | ||
| return List.of( | ||
| new FixedExecutorBuilder( | ||
| settings, | ||
| AsyncRestExecutor.SQL_WORKER_THREAD_POOL_NAME, | ||
| SQL_WORKER_THREAD_POOL_NAME, | ||
| OpenSearchExecutors.allocatedProcessors(settings), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if this is the best number.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally it should match the number of search threads since that's where all the requests go, maybe I can find where that number is stored and do a lookup.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| 1000, | ||
| null)); | ||
vamsimanohar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "thread_pool." + SQL_WORKER_THREAD_POOL_NAME), | ||
| new FixedExecutorBuilder( | ||
vamsimanohar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| settings, | ||
| SQL_BACKGROUND_THREAD_POOL_NAME, | ||
| OpenSearchExecutors.allocatedProcessors(settings), | ||
| 100, // No external API connects to this, we should have sane resource usage | ||
| "thread_pool." + SQL_BACKGROUND_THREAD_POOL_NAME)); | ||
| } | ||
|
|
||
| @Override | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.