Skip to content

[core] Reject non-positive global index read thread counts#8853

Merged
JingsongLi merged 2 commits into
apache:masterfrom
QuakeWang:validate-global-index-threads
Jul 27, 2026
Merged

[core] Reject non-positive global index read thread counts#8853
JingsongLi merged 2 commits into
apache:masterfrom
QuakeWang:validate-global-index-threads

Conversation

@QuakeWang

Copy link
Copy Markdown
Member

Purpose

global-index.thread-num accepted zero or negative values, creating a semaphored executor without available permits and causing global index reads to block during task submission.

Validate the thread count at the shared pool boundary and fail fast with a clear error.

Tests

  • mvn -pl paimon-core -am -DfailIfNoTests=false -DwildcardSuites=none -Dtest=GlobalIndexReadThreadPoolTest test

Non-positive global-index.thread-num values create a semaphored executor
without available permits, causing global index reads to block on task
submission.

Fail fast with a clear validation error and cover zero and negative values.

Signed-off-by: QuakeWang <[email protected]>
createCachedThreadPool(Runtime.getRuntime().availableProcessors(), THREAD_NAME);

public static synchronized ExecutorService getExecutorService(int threadNum) {
checkArgument(threadNum > 0, "Option 'global-index.thread-num' must be greater than 0.");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Would it be helpful to add this in the option description for generated config docs?

    public static final ConfigOption<Integer> GLOBAL_INDEX_THREAD_NUM =
            key("global-index.thread-num")
                    .intType()
                    .defaultValue(32)
                    .withDescription(
                            "The maximum number of concurrent threads for global index I/O.");

+ Must be greater than 0.

@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit e818190 into apache:master Jul 27, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants