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

[BugFix] Use a separate thread pool for dictionary collection (backport #54454) #54512

Merged
merged 2 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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: 3 additions & 0 deletions fe/fe-core/src/main/java/com/starrocks/common/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -1929,6 +1929,9 @@ public class Config extends ConfigBase {
@ConfField
public static long statistic_dict_columns = 100000;

@ConfField
public static int dict_collect_thread_pool_size = 16;

/**
* The column statistic cache update interval
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.starrocks.common.Config;
import com.starrocks.common.Pair;
import com.starrocks.common.Status;
import com.starrocks.common.ThreadPoolManager;
import com.starrocks.memory.MemoryTrackable;
import com.starrocks.qe.ConnectContext;
import com.starrocks.server.GlobalStateMgr;
Expand Down Expand Up @@ -53,7 +54,7 @@ public class CacheDictManager implements IDictManager, MemoryTrackable {

public static final Integer LOW_CARDINALITY_THRESHOLD = 255;

private CacheDictManager() {
public CacheDictManager() {
}

private static final CacheDictManager INSTANCE = new CacheDictManager();
Expand Down Expand Up @@ -106,6 +107,8 @@ public CompletableFuture<Optional<ColumnDict>> asyncReload(

private final AsyncLoadingCache<ColumnIdentifier, Optional<ColumnDict>> dictStatistics = Caffeine.newBuilder()
.maximumSize(Config.statistic_dict_columns)
.executor(ThreadPoolManager.newDaemonCacheThreadPool(Config.dict_collect_thread_pool_size, "cache-dict",
false))
.buildAsync(dictLoader);

private Optional<ColumnDict> deserializeColumnDict(long tableId, String columnName, TStatisticData statisticData) {
Expand Down
Loading