<@U0A71G31CDV> can you please clearly explain purp...
# questions-and-troubleshooting
p
@Rocky can you please clearly explain purpose of this variable and when you would use it? "enable_query_tablet_affinity(2.5 and later) Boolean value to control whether to direct multiple queries against the same tablet to a fixed replica. In scenarios where the table to query has a large number of tablets, this feature significantly improves query performance because the meta information and data of the tablet can be cached in memory more quickly. However, if there are some hotspot tablets, this feature may degrade the query performance because it directs the queries to the same BE, making it unable to fully use the resources of multiple BEs in high-concurrency scenarios. Default value:
false
, which means the system selects a replica for each query. This feature is supported since 2.5.6, 3.0.8, 3.1.4, and 3.2.0."
r
The system variable
enable_query_tablet_affinity
is a performance optimization setting in StarRocks (available from v2.5.6, v3.0.8, v3.1.4, and v3.2.0 onwards). Here is a clear explanation of its purpose and when you should use it. 1. The Purpose By default, StarRocks uses a round-robin or load-balancing approach to pick which replica (on which BE/CN node) should handle a query for a specific tablet. When
enable_query_tablet_affinity
is set to
true
, the FE (Frontend) will attempt to consistently route queries for the same tablet to the same node. The goal is Cache Locality. By pinning a tablet to a specific node, that node can: * Reuse Page Cache/Data Cache: The actual data blocks stay in the node's memory or local disk cache, avoiding expensive I/O or remote storage fetches. * Reuse Metadata Cache: Tablet meta-information (schema, indexes, etc.) stays "warm" in the BE's memory. * Reduce Remote I/O (Shared-Data): In Cloud-Native (Shared-Data) clusters, this prevents multiple Compute Nodes (CNs) from all downloading and caching the same data from S3/remote storage. 2. When to Use It (The "Pro" Scenarios) You should consider enabling this in the following situations: * Shared-Data / Cloud-Native Clusters: This is arguably the most important use case. Since data lives on remote storage (S3/HDFS), routing the same tablet to the same CN ensures the "Data Cache" is highly effective. * Large Metadata Overhead: If your table has a massive number of tablets, caching the metadata on a fixed BE significantly speeds up query planning and initial execution. * Repeatable Query Patterns: If your application frequently queries the same set of data (e.g., a dashboard refreshing the same "today's" data), affinity ensures the data is always "hot" on the target node. * Data Lake Queries: When querying external tables (Iceberg, Hudi, Hive), consistent routing helps the local Data Cache (formerly File Cache) perform better. 3. When to Avoid It (The "Con" Scenarios) Do not enable this (or leave it at the default
false
) if: * Hotspot Tablets: If you have severe data skew where a few tablets are queried 1,000x more than others, one BE will become a bottleneck while others sit idle. * Very High Concurrency on Small Datasets: If you have a small number of tablets but a very large number of concurrent users, you might want to spread those users across all available replicas to maximize CPU utilization, even if it means some cache misses. * Small Clusters: In very small clusters where replicas are already limited, the natural distribution of queries is usually sufficient. Summary * Default:
false
(Load balancing prioritized over cache). * Recommended:
true
for Cloud-Native (Shared-Data) or Data Lake scenarios to maximize cache hits. * Watch out for: CPU hotspots on specific BEs if your query patterns are skewed toward specific keys. How to enable it:
Copy code
sql
-- For the current session
SET enable_query_tablet_affinity = true;

-- Globally for all future sessions
SET GLOBAL enable_query_tablet_affinity = true;
Referencessql-reference/System_variable.mddeployment/shared_data/feature-support-shared-data.mdfaq/shared_data_faq.mddata_source/data_cache.mdadministration/management/FE_configuration.md
p
@Rocky Any other settings related to enable_query_tablet_affinity?
r
When you enable
enable_query_tablet_affinity
, you are essentially telling StarRocks to "stick" certain pieces of data to specific compute nodes to make better use of caches. Because of this, it is rarely used in isolation. Here are the other settings and features that are closely related to or complement this variable: 1. Data Cache (Shared-Data & Data Lake) This is the most common reason to use tablet affinity. If you are using a Cloud-Native (Shared-Data) cluster or querying an external Data Lake (Iceberg, Hive, etc.), the data is cached on the BE/CN local disks. *
enable_scan_datacache
(System Variable):
Must be
true
(default in newer versions) for the data cache to actually be used. Without this, affinity won't provide much "data" benefit. *
enable_datacache_sharing
(System Variable):
If a node is busy or a cluster scales, affinity might move a tablet to a new node. This setting allows the new node to "borrow" the cache from the old node over the network instead of going back to S3/HDFS. *
enable_datacache_io_adaptor
(System Variable):
If the node's disk is too busy, this tells StarRocks whether to bypass the local cache and go to remote storage. 2. Parallelism Settings When you pin a tablet to a single node using affinity, you might worry that you aren't using all the CPU cores on that node for that specific tablet. *
enable_tablet_internal_parallel
(System Variable):
Set this to
true
(default). It allows StarRocks to use multiple threads to scan a single tablet. This prevents a "pinned" tablet from being a bottleneck by allowing it to use multiple cores on its assigned BE. * `pipeline_dop`: Controls the overall parallelism. Higher DOP works well with tablet affinity to ensure that even if queries are routed to specific nodes, they are processed as fast as possible using available resources. 3. Replica & Node Selection *
enable_local_replica_selection
(FE Configuration):
While
enable_query_tablet_affinity
focuses on consistency (same node every time), this setting focuses on locality (picking a BE that is physically on the same machine as the FE). Usually, affinity is more powerful for cache performance. *
lake_enable_balance_tablets_between_workers
(FE Configuration):
In shared-data clusters, this controls how the FE balances the "ownership" of tablets across nodes. If you have affinity on, this balancing logic determines which node is the "fixed" one for a particular tablet. 4. Query Cache (Result-Set Cache) *
enable_query_cache
(System Variable):
This is a different type of cache that stores the results of a query. While not strictly the same as the "data cache" helped by tablet affinity, the documentation often groups them together under "StarRocks Caching" strategies. Summary: When to combine them? If your goal is maximum performance on a Data Lake or Shared-Data cluster, you should typically have: 1.
enable_query_tablet_affinity = true
(To keep routing consistent) 2.
enable_scan_datacache = true
(To use the local disk cache) 3.
enable_tablet_internal_parallel = true
(To keep scans fast on a single node) 4.
enable_datacache_sharing = true
(To handle cluster scaling gracefully) Referencessql-reference/System_variable.mddata_source/data_cache.mddeployment/shared_data/feature-support-shared-data.mdusing_starrocks/caching/query_cache.mdusing_starrocks/caching/block_cache.mddata_source/data_cache_troubleshooting.md
p
@Rocky should lake_enable_balance_tablets_between_workers be true or false if you have
enable_query_tablet_affinity
set to true?
r
The short answer is: You should generally keep
lake_enable_balance_tablets_between_workers
set to
true
(the default).
Here is the logic for how these two settings work together and why you wouldn't typically disable balancing just because you are using tablet affinity. 1. How they interact *
lake_enable_balance_tablets_between_workers
(Structural Balance):
This FE configuration determines which Compute Node (worker) "owns" or is the primary handler for a tablet's metadata in a Shared-Data cluster. Its job is to make sure that if you have 10 nodes and 1,000 tablets, each node handles roughly 100 tablets. *
enable_query_tablet_affinity
(Execution Routing):
This session/global variable tells the FE to consistently send queries for Tablet A to its "owner" node. This ensures the owner node can build up a "hot" local cache of that tablet's data. 2. Why you should keep it
true
If you set balancing to
false
, the cluster becomes static. This creates a major problem when you scale your cluster: * Scenario: You have 3 nodes and 100% of your tablets are distributed among them. You then add 7 more nodes to handle a spike in traffic. * The Problem: If balancing is
false
, the 7 new nodes will stay empty. The original 3 nodes will continue to handle 100% of the queries because the tablet "affinity" is stuck to them. * The Result: You are paying for 10 nodes but only 3 are doing any work. By keeping balancing
true
, StarRocks will slowly migrate some tablets to the new nodes. While a tablet is migrating, you might see a temporary cache miss on the new node, but once the migration is finished,
enable_query_tablet_affinity
will "lock" queries to the new node, allowing it to build its own local cache. 3. When would you ever set it to
false
?
You would only set
lake_enable_balance_tablets_between_workers
to
false
in very rare, temporary situations: * During critical high-traffic windows: If you are in the middle of a massive sale or event and you don't want even a tiny bit of background "shuffling" or "cache warming" to happen, you might temporarily disable balancing to ensure maximum stability. * Troubleshooting: If you suspect that tablet migration is causing CPU spikes or network congestion and you want to isolate the issue. Summary Table Setting | Recommended Value | Purpose
lake_enable_balance_tablets_between_workers
|
true
| Ensures all BE/CN nodes share the workload equally over the long term.
enable_query_tablet_affinity
|
true
| Ensures that once a workload is assigned to a node, it stays there to maximize cache performance. Recommendation: Set
enable_query_tablet_affinity
to
true
to get the performance boost of the Data Cache, but leave the FE configuration
lake_enable_balance_tablets_between_workers
at its default
true
so your cluster remains elastic and balanced. Referencessql-reference/System_variable.mdadministration/management/FE_configuration.mdusing_starrocks/Colocate_join.mdadministration/management/resource_management/Replica.mdtable_design/data_distribution/Data_distribution.md
p
Is there any other tuning parameters that would explain why it seems like existing CNs or FEs are trying to pass work over to new CNs as soon as they come online?
@Rocky Is there any other tuning parameters that would explain why it seems like existing CNs or FEs are trying to pass work over to new CNs as soon as they come online?
r
The reason you are seeing work shift almost immediately to new Compute Nodes (CNs) when they come online is due to StarRocks' Automatic Load Balancing and Tablet Scheduling logic. In a Shared-Data (Cloud-Native) cluster, this process is much faster than in a traditional cluster because there is no physical data to move—only the "ownership" (the metadata assignment) of the tablets needs to be updated in the FE. Here are the specific tuning parameters that control this behavior: 1. The Trigger: Load Score Threshold The FE constantly calculates a Load Score for every node. A new CN starts with a score of 0 (no tablets, no queries). *
tablet_sched_balance_load_score_threshold
(Default: 0.1):
This is the "sensitivity" of the rebalancer. If the difference between a node's load and the cluster average exceeds this value (10%), the FE marks the cluster as "unbalanced" and immediately starts moving tablets to the new, low-load node. _ _To slow this down:* Increase this value (e.g., to
0.5
), so the FE only moves work when there is a massive imbalance. 2. The Speed: Balancing Concurrency Once an imbalance is detected, these parameters control how "aggressive" the transfer is: *
tablet_sched_max_balancing_tablets
(Default: 500):
This limits how many tablets the FE will try to reassign at any single moment. If you see a massive "wave" of work moving to a new node, reducing this number will make the migration more gradual. *
tablet_sched_checker_interval_seconds
(Default: 20s):
This is how often the FE checks if it needs to balance the cluster. A shorter interval means the FE reacts almost instantly to a new CN joining. 3. Shared-Data Specific Control In Shared-Data mode, there is a master switch for this behavior: *
lake_enable_balance_tablets_between_workers
(Default: true):
As discussed earlier, this is the primary toggle. If this is
true
, the FE will actively try to give the new CN an equal share of the tablets. *
lake_tablet_report_interval_ms
(Default: 60000):
This controls how often CNs report their tablet status to the FE. While this doesn't trigger the balance, it affects how quickly the FE "sees" that the new node is ready and healthy to take over work. 4. Query Routing vs. Metadata Assignment It is important to distinguish between Tablet Ownership and Query Execution: * Metadata: The FE reassigns the tablet "master" to the new CN. * Execution: Because you have
enable_query_tablet_affinity
set to
true
, the query planner sees the new assignment and immediately routes the next query for that tablet to the new CN. Why it feels "Instant" In a Shared-Nothing cluster, moving a tablet requires copying Gigabytes of data over the network to the new node before it can take over. In Shared-Data (Lake) mode, the FE just updates a pointer saying _"CN_New now handles Tablet_A."_ Since the data is already on S3/HDFS, the new CN can start scanning it the millisecond it receives the request. Summary of what to tune: * If you want it to be LESS aggressive: Increase
tablet_sched_balance_load_score_threshold
and decrease
tablet_sched_max_balancing_tablets
. * If you want to stop it entirely (not recommended for scaling): Set
lake_enable_balance_tablets_between_workers
to
false
. Referencesadministration/management/FE_configuration.mdadministration/management/resource_management/Replica.mddeployment/shared_data/feature-support-shared-data.mdfaq/shared_data_faq.mdusing_starrocks/caching/block_cache.md References
p
@Rocky difference between
tablet_sched_max_balancing_tablets
and
tablet_sched_max_scheduling_tablets
?
r
In StarRocks, these two parameters control the "bandwidth" of the FE's background tablet management, but they operate at different levels of the hierarchy. 1.
tablet_sched_max_scheduling_tablets
(The Global Limit)
Think of this as the total capacity of the FE's scheduling engine. * Purpose: It limits the total number of tablets the FE will look at for any reason (either balancing or repairing) at a single point in time. * Scope: This includes: * Repairing: Re-creating replicas when a node fails. * Balancing: Moving tablets from a hot/full node to a cold/empty node. * Default:
10000
* Effect: If the number of tablets needing attention exceeds this value, the FE will simply stop picking up new tasks for both balancing and repair until the queue clears. 2.
tablet_sched_max_balancing_tablets
(The Balancing Limit)
Think of this as a sub-limit specifically for load balancing. * Purpose: It limits how much of the "scheduling capacity" can be used for re-balancing (moving data to even out the cluster). * Scope: Only applies to balancing tasks. It does not affect repair tasks (which are usually higher priority because they ensure data safety). * Default:
500
* Effect: If you have 10,000 tablets needing repair and 500 tablets needing balancing, the
max_scheduling_tablets
limit is reached. However, if the cluster is healthy (0 repairs) but unbalanced, the FE will still only move 500 tablets at a time because of this specific limit. ────────── Key Differences at a Glance Feature |
tablet_sched_max_scheduling_tablets
|
tablet_sched_max_balancing_tablets
Category | Global/Total Limit | Specific/Sub-Limit Covers | Balancing + Repairs | Only Balancing Default Value | 10,000 | 500 Primary Goal | Prevents FE overload from too many tasks. | Prevents balancing from consuming too many resources (IO/Network). Practical Tip for Scaling When you add a new node and want work to move over faster, you often need to increase both. If you only increase
max_balancing_tablets
to 5,000 but leave
max_scheduling_tablets
at its default (or if it's already full of repair tasks), the balancing won't speed up as much as you'd expect. To speed up a new node joining a large cluster:
Copy code
sql
ADMIN SET FRONTEND CONFIG ("tablet_sched_max_scheduling_tablets" = "20000");
ADMIN SET FRONTEND CONFIG ("tablet_sched_max_balancing_tablets" = "2000");
Referencesadministration/management/FE_configuration.mdfaq/operation_maintenance_faq.mdadministration/management/resource_management/Replica.md Referencesadministration/management/FE_configuration.mdfaq/operation_maintenance_faq.md
p
@Rocky What is difference between tablet and fragment?
r
In StarRocks, the terms Tablet and Fragment represent two completely different layers of the system: one belongs to Storage and the other belongs to Execution. Here is the breakdown of the differences: 1. Tablet (The Unit of Storage) A Tablet is the fundamental unit of physical data storage and distribution. * What it is: When you create a table, StarRocks divides the data into partitions, and then further divides those partitions into Buckets. Each bucket is a Tablet. * Creation: It is defined by your DDL (e.g.,
DISTRIBUTED BY HASH(user_id) BUCKETS 32
). * Location: Tablets are stored on the disks of Backend (BE) nodes (or on S3/cloud storage in Shared-Data mode). * Role: It is the unit of data replication, balancing, and recovery. If a node fails, StarRocks moves tablets to other nodes. * Lifecycle: Long-term. It exists as long as the table exists. 2. Fragment (The Unit of Execution) A Fragment (or Plan Fragment) is the fundamental unit of query execution. * What it is: When you run a SQL query, the FE Optimizer breaks the execution plan into several "slices" or stages. Each slice is a Fragment. * Creation: It is generated dynamically by the FE for every SQL query. * Location: Fragments are sent to BEs to be executed. A single fragment is often parallelized into multiple Fragment Instances across different nodes to process data in parallel. * Role: Each fragment handles a specific part of the query (e.g., one fragment might scan a table, another might perform a Join, and another might handle the final sorting/aggregation). * Lifecycle: Short-term. It only exists for the duration of the query. ────────── How they work together To understand the difference, look at how a simple query like
SELECT SUM(sales) FROM orders
works: 1. The Fragment: The FE creates a "Scan & Aggregate Fragment." 2. The Fragment Instance: If the
orders
table has 100 Tablets spread across 10 BE nodes, the FE will create 10 Fragment Instances (one for each node). 3. The Interaction: Each Fragment Instance is responsible for reading the specific Tablets stored on its local node, calculating a partial sum, and sending the result to the next fragment in the chain. Key Comparison Table Feature | Tablet | Fragment Domain | Storage / Data Management | Computing / Query Execution Defined By | Table Schema (DDL) | SQL Query (Optimizer) Unit of... | Replication & Distribution | Parallelism & Scheduling Durability | Persistent (Stored on disk) | Ephemeral (Exists during query) Relationship | A table has many tablets. | A query plan has one or more fragments. Analogy | Like the books on a library shelf. | Like the task given to a person to go read those books. In short: Tablets are where the data sits, and Fragments are the instructions that tell the system how to process that data. Referencesbest_practices/query_tuning/query_planning.mdintroduction/Architecture.mdusing_starrocks/caching/query_cache.md
p
@Rocky why is
tablet_sched_max_scheduling_tablets
500?
r
It looks like there might be a slight mix-up in the parameter names. According to the StarRocks documentation and the system defaults: *
tablet_sched_max_scheduling_tablets
actually defaults to 10,000. *
tablet_sched_max_balancing_tablets
is the one that defaults to 500. If you are seeing a limit of 500 in your environment or are wondering why the balancing limit is specifically set to 500, here is the reasoning: 1. Resource Protection (Query Performance) The primary reason for the 500 limit on balancing is to prevent background maintenance from hurting foreground query performance. Moving tablets (especially in Shared-Nothing mode) requires CPU for checksums, network bandwidth for transfer, and Disk I/O for reading/writing. If StarRocks tried to move 10,000 tablets at once, your queries would likely experience significant latency spikes or "jitter." 2. Stability vs. Agility StarRocks prioritizes stability by default. * Scheduling (10,000): This is high because "Scheduling" includes repairs. If a node goes down, the system needs to be very aggressive about fixing replicas to prevent data loss. * Balancing (500): This is lower because "Balancing" is just optimization. Your data is safe; it's just not perfectly distributed. The system takes a "slow and steady" approach to avoid overwhelming the cluster. 3. Preventing "Ping-Pong" Effects In a highly dynamic environment, if the limit is too high, the system might move thousands of tablets to a new node, only for that node's load to spike, causing the FE to immediately try to move them back. A lower limit allows the FE to move a batch, wait for the cluster's load metrics to "settle," and then decide if it needs to move more. How to change it If you have a very large cluster or high-speed networking and you want to scale out faster, you can increase this limit safely:
Copy code
sql
-- Increase the concurrent balancing tasks to 2000
ADMIN SET FRONTEND CONFIG ("tablet_sched_max_balancing_tablets" = "2000");

-- Ensure the global scheduling limit is high enough to accommodate the change
ADMIN SET FRONTEND CONFIG ("tablet_sched_max_scheduling_tablets" = "20000");
Summary: If it feels like
tablet_sched_max_scheduling_tablets
is capped at 500, it is almost certainly because the
tablet_sched_max_balancing_tablets
sub-limit is throttling the process. Referencesadministration/management/FE_configuration.mdfaq/operation_maintenance_faq.mdadministration/management/resource_management/Replica.md Referencesadministration/management/FE_configuration.mdfaq/operation_maintenance_faq.md
p
@Rocky why is
tablet_sched_max_balancing_tablets
500?
r
The default value of 500 for
tablet_sched_max_balancing_tablets
is a conservative "safety first" limit designed to protect the health and performance of your cluster. Here is the reasoning behind why it is set to 500: 1. Protection of Foreground Queries (The "Noisy Neighbor" Problem) Balancing is a resource-intensive background process. To move a tablet from one node to another, the system must: * Read data from the source disk. * Transfer data across the network. * Write data to the destination disk. * Verify checksums on both ends. If the limit were set much higher (e.g., 5,000), a massive re-balance could saturate your network bandwidth or disk I/O, causing your SQL queries to slow down or time out. 500 is a "sweet spot" that allows progress without noticeably impacting user traffic. 2. Prioritization of Safety over Optimization In StarRocks' scheduling logic, there are two types of movements: * Repairs: Fixes missing replicas (Critical for data safety). * Balancing: Evens out data distribution (Optimization). The global limit (
max_scheduling_tablets
) is much higher (10,000) so that if a node fails, the system can aggressively repair thousands of tablets at once. By capping balancing at only 500, StarRocks ensures that re-balancing tasks never "crowd out" critical repair tasks. 3. Preventing System Jitter Balancing is based on the current load and disk usage of nodes. If the system moved too many tablets at once, the "weight" of the nodes would change so drastically that the FE might immediately decide the cluster is unbalanced in the opposite direction. Moving 500 tablets at a time allows the FE to reassess the cluster state in small increments, preventing "ping-pong" data movement. When should you change it? While 500 is a safe default, you should increase it in these specific scenarios: * Adding New Nodes: If you add 10 new nodes to a large cluster, moving only 500 tablets at a time will make the expansion feel very slow. * Off-Peak Maintenance: If you have a maintenance window where no queries are running, you can crank this up to 2,000+ to finish balancing faster. * High-Speed Hardware: If your cluster uses NVMe drives and 100Gbps networking, the default 500 limit is likely too restrictive for your hardware's capabilities. To increase it temporarily for a faster scale-out:
Copy code
sql
ADMIN SET FRONTEND CONFIG ("tablet_sched_max_balancing_tablets" = "2000");
Referencesadministration/management/FE_configuration.mdfaq/operation_maintenance_faq.mdadministration/management/resource_management/Replica.md Referencesadministration/management/FE_configuration.mdfaq/operation_maintenance_faq.mdfaq/Deploy_faq.md
p
@Rocky If I set tablet_sched_max_balancing_tablets to 10 what is going to happen?
r
If you set
tablet_sched_max_balancing_tablets
to 10, you are effectively putting the cluster's data rebalancing process into "ultra-slow" mode. Here is exactly what will happen across different aspects of your cluster: 1. Extremely Slow Scale-Out/Scale-In If you add a new node or decommission an old one, the process will take significantly longer. * The Math: If you add a new BE and need to move 5,000 tablets to it to balance the load, at a limit of 10 concurrent tasks, the system will only move 10 tablets at a time. * Result: A process that might usually take 30 minutes (with the default 500) could now take many hours or even days, depending on the size of your tablets. 2. "Near-Zero" Background Impact This is the only potential benefit. Because only 10 tablets are moving at once: * Network Bandwidth: There will be almost no noticeable background network traffic from rebalancing. * Disk I/O: Your BE disks will face negligible extra load from background clones. * CPU: The overhead for checksums and data validation will be invisible. * Query Stability: If your environment is extremely sensitive to "jitter" (millisecond-level latency spikes), this setting ensures that background maintenance never interferes with foreground SQL queries. 3. Persistent "Unbalanced" State In a busy cluster where data is constantly being ingested and new partitions are created, a limit of 10 might be slower than the rate of data growth. * If you ingest data faster than the balancer can move it (at 10 tablets at a time), your cluster may never reach a truly balanced state. * Some nodes might stay at 90% disk usage while others stay at 10% for a much longer period, potentially leading to "hotspot" BEs that slow down specific queries. 4. What you will see in the System If you run monitoring commands, you will see the following: *
SHOW PROC '/cluster_balance/running_tablets';
: You will never see more than 10 tasks with the type
BALANCE
. *
SHOW PROC '/cluster_balance/pending_tablets';
: If the cluster is unbalanced, you might see a massive queue of thousands of tablets waiting for one of those 10 "slots" to open up. *
SHOW PROC '/cluster_balance/balance_stat';
: The
Balanced
column will likely stay
false
for a very long time. Recommendation * Don't do this during expansion: If you just added nodes, keep this at 500 or even increase it to 1000-2000. * Only do this for "Quiet" clusters: If your cluster is already perfectly balanced and you want to ensure that no unexpected background moves happen during a high-traffic event (like a Black Friday sale), lowering it to 10 is a safe way to "throttle" the system without completely disabling it. Note: This limit does not affect Repairs. If a node fails, StarRocks will still use the much larger
tablet_sched_max_scheduling_tablets
limit (default 10,000) to quickly recover your data redundancy. Referencesadministration/management/FE_configuration.mdadministration/management/resource_management/Replica.mdfaq/operation_maintenance_faq.md Referencesadministration/management/resource_management/Replica.mdsql-reference/sql-statements/cluster-management/nodes_processes/SHOW_PROC.md
p
@Rocky explain the purpose of all 4 of these : ADMIN SET FRONTEND CONFIG ("tablet_sched_max_scheduling_tablets" = "0"); ADMIN SET FRONTEND CONFIG ("tablet_sched_max_balancing_tablets" = "0"); ADMIN SET FRONTEND CONFIG ("disable_balance"="true"); ADMIN SET FRONTEND CONFIG ("disable_colocate_balance"="true");
r
These four configurations are used to control how StarRocks moves data (tablets) around the cluster. While they seem similar, they control different "valves" and have different levels of severity. Here is the breakdown of why you would set each one: 1.
tablet_sched_max_scheduling_tablets
= "0"
* The "Nuclear Option" (Global Stop) * Purpose: This is the global cap for all tablet-related tasks, including both Repairs (fixing missing data) and Balancing (optimizing data distribution). * What happens if set to 0: The FE will skip all scheduling and repair checks. If a BE node crashes, StarRocks will not attempt to recreate the missing replicas on other nodes. * When to use: Only in extreme emergencies where the FE is overloaded by millions of scheduling tasks, or during a massive cluster-wide migration where you want zero background movement. Use with caution, as it stops data safety repairs. 2.
tablet_sched_max_balancing_tablets
= "0"
* The "Efficiency Stop" (Optimization Only) * Purpose: This specifically limits the number of balancing tasks. Balancing is the process of moving data from a "full" node to an "empty" node to even things out. * What happens if set to 0: The cluster will stop trying to even out data distribution. However, unlike the global limit above, if a node fails, the cluster will still perform repairs to ensure data redundancy is maintained. * When to use: Use this if you want to stop background "shuffling" of data to save Disk/Network I/O, but you still want the cluster to be able to fix itself if a node goes down. 3.
disable_balance
= "true"
* The "Standard Pause" Button * Purpose: This is the primary logic switch to turn off the Balancer. * What happens if set to true: The FE's balancer thread will simply not run. It is functionally very similar to setting
max_balancing_tablets
to 0, but it is the "cleaner" way to do it through a boolean flag rather than a capacity limit. * When to use: This is the standard command used during cluster maintenance (like upgrading BEs one by one) to prevent the cluster from trying to rebalance data every time a node temporarily goes offline. 4.
disable_colocate_balance
= "true"
* The "Specialized Stop" (Colocate Join Safety) * Purpose: Specifically controls the balancing of Colocate Groups. Colocate tables are tables that are forced to store their data on the same set of BE nodes to make Joins extremely fast. * What happens if set to true: Even if standard balancing is enabled, the system will not move tablets that belong to Colocate Groups. * When to use: Use this if you have complex Colocate Join setups and you notice that the "Colocate" property is frequently becoming "unstable" (flipping between stable and unstable), which can cause query plan failures. It locks the Colocate tables in their current positions. ────────── Summary Table Configuration | Stops Repairs? | Stops Balancing? | Use Case
max_scheduling_tablets = 0
| Yes | Yes | Total emergency freeze.
max_balancing_tablets = 0
| No | Yes | Throttling background load.
disable_balance = true
| No | Yes | Standard maintenance/rolling upgrades.
disable_colocate_balance = true
| No | Only Colocate | Protecting Colocate Join performance. Recommended Practice: If you are doing maintenance, use
disable_balance = true
. Avoid setting the
max_scheduling
limit to 0 unless you are directed to by an expert, as it puts your data at risk if a disk fails. Referencesadministration/management/FE_configuration.mdadministration/management/resource_management/Replica.mdfaq/operation_maintenance_faq.md References
p
@Rocky If
disable_balance
is false but
tablet_sched_max_scheduling_tablets
is 0 does that mean balancing will not work?
r
Yes, that is correct. If
tablet_sched_max_scheduling_tablets
is set to 0, balancing will not work, even if
disable_balance
is set to
false
. Think of it like this:
disable_balance
is the On/Off switch for the balancer logic, while
max_scheduling_tablets
is the capacity (size of the pipe) for all data movement tasks. Why it won't work: 1. Global Cap:
tablet_sched_max_scheduling_tablets
is a global limit that covers both Repairs (fixing bad/missing replicas) and Balancing (shuffling data for even distribution). 2. Skipping Logic: StarRocks' internal scheduler checks this limit before doing anything. If the number of currently running tasks is greater than or equal to this limit, the system skips both balancing and repair checks entirely to save FE resources. 3. Result: When the limit is 0, the "pipe" is effectively closed. Even though the balancer (the switch) is "On," it cannot push any tasks through a pipe with 0 capacity. Key Differences in behavior: Scenario | Balancing? | Repairs? | System Behavior
disable_balance = true
| NO | YES | Standard way to pause maintenance movement while keeping data safe.
max_scheduling_tablets = 0
| NO | NO | Dangerous. Stops all data movement. If a BE node fails, the cluster will not fix the missing replicas.
max_balancing_tablets = 0
| NO | YES | Effectively the same as
disable_balance = true
. Summary If you set
max_scheduling_tablets
to 0, you are effectively "freezing" the state of all data in the cluster. No tablets will move for any reason. If your goal is just to stop the background balancing (the "shuffling") but you still want the cluster to be able to fix itself if a node dies, you should use
ADMIN SET FRONTEND CONFIG ("disable_balance" = "true");
instead. Referencesadministration/management/FE_configuration.mdadministration/management/resource_management/Replica.mdfaq/operation_maintenance_faq.md Referencesadministration/management/FE_configuration.mdfaq/operation_maintenance_faq.mdadministration/management/resource_management/Replica.md
p
@Rocky how do you know which tablets are fixed to which CNs?
r
In a StarRocks shared-data (cloud-native) cluster, tablets are stored in remote object storage (like S3 or HDFS), but they are "mapped" to specific Compute Nodes (CNs) to manage local data caching, compaction tasks, and metadata. This mapping is not "fixed" permanently (like a physical replica), but is assigned via consistent hashing through an internal layer called Starlet. If a CN node is added or removed, the mapping will automatically rebalance. Here are the ways you can see which tablets are currently assigned to which CNs: 1. Using
SHOW TABLET
This is the most direct way to see the mapping for a specific table.
Copy code
sql
SHOW TABLET FROM <database_name>.<table_name>;
* In Shared-Data clusters: The
BackendId
column in the output refers to the ComputeNodeId. * Each row shows a
TabletId
and the
BackendId
(CN) currently responsible for it. 2. Using
information_schema.be_tablets
You can query the system metadata tables to get a list of all tablets and their corresponding nodes.
Copy code
sql
SELECT 
    BE_ID AS CN_ID, 
    TABLE_ID, 
    TABLET_ID, 
    DATA_SIZE 
FROM information_schema.be_tablets 
WHERE TABLE_ID = <your_table_id>;
* The
BE_ID
here represents the CN ID in a shared-data environment. 3. Using
SHOW COMPUTE NODES
If you want to see the total "load" (how many tablets are assigned to each node) rather than the specific IDs, use:
Copy code
sql
SHOW COMPUTE NODES;
* Look at the
TabletNum
column. This shows the total count of tablets that the specific CN is currently "owning" for caching and maintenance purposes. 4. Detailed Metadata via
SHOW PROC
For a deep dive into a specific tablet's location and metadata: 1. Find the
TabletId
from Step 1. 2. Run:
Copy code
sql
    SHOW TABLET <tablet_id>;
This will return a
DetailCmd
. Running the command in that column (or looking at the summary) will show you the database, table, and partition info, along with the node it resides on. 5. Checking Compaction Responsibility Since CNs are responsible for the compaction of the tablets they "own," you can also check the mapping via the compaction status:
Copy code
sql
SELECT * FROM information_schema.be_cloud_native_compactions;
* This shows which
BE_ID
(CN) is currently performing or has performed compaction tasks for specific `TABLET_ID`s. Summary of terminology * Shared-Nothing: The tablet is stored on a BE. The mapping is strict and requires "cloning" to change. * Shared-Data: The tablet is mapped to a CN. The mapping is logic-based (consistent hashing). The CN caches the data locally but the source of truth is the object storage. Referencessql-reference/sql-statements/table_bucket_part_index/SHOW_TABLET.mdsql-reference/sql-statements/cluster-management/nodes_processes/SHOW_COMPUTE_NODES.mdsql-reference/information_schema/be_tablets.mdfaq/shared_data_faq.md Referencessql-reference/information_schema/be_tablets.mdsql-reference/sql-statements/table_bucket_part_index/SHOW_TABLET.mdsql-reference/information_schema/be_cloud_native_compactions.mdfaq/shared_data_faq.mdsql-reference/information_schema/be_txns.md
p
@Rocky if tablet_sched_max_scheduling_tablets was lowered to lets say 500. Does it move 500 tablets and than reset after certain amount of time?
r
No, it does not work like a "batch quota" that moves 500 and then waits for a timer to reset. Instead, it is a concurrency cap (a "limit on active work"). Here is exactly how the logic works when you set
tablet_sched_max_scheduling_tablets
to 500: 1. It is a "Live" Limit (Concurrency) StarRocks keeps a counter of how many tablet tasks (Repairs or Balances) are currently in progress. * If the number of active tasks is 499, the scheduler will pick up 1 more tablet to move. * If the number of active tasks is 500, the scheduler "skips" its check and does nothing. * The moment one of those 500 tablets finishes moving, the counter drops to 499, and the scheduler is allowed to pick a new one in its next internal loop. 2. The "Scheduler Loop" vs. "Time Resets" There is no "reset time." StarRocks runs a background thread (the
TabletScheduler
) that wakes up very frequently (usually every few seconds or less) to check the health of the cluster. * Each time it wakes up, it looks at the current count. * If
current_tasks < 500
, it adds more tasks until it hits 500. * If
current_tasks >= 500
, it goes back to sleep until the next cycle. 3. Why it might feel like it moves in batches If you have 10,000 tablets that need to be moved (e.g., you added a new node) and you set the limit to 500: 1. StarRocks will immediately start 500 tasks. 2. It will wait for those specific tasks to finish. Since tablet sizes vary, they will finish at different times. 3. As tasks finish, StarRocks "trickles" in new ones to maintain exactly 500 in-flight. 4. If your network/disks are fast, it will look like a continuous stream of 500 active tasks until all 10,000 are done. Summary Lowering this to 500 effectively throttles the speed of your data movement. It prevents the Frontend (FE) and the network from being overwhelmed by trying to move too many things at once. It doesn't "pause" for a set time; it just ensures that at any single moment, no more than 500 tablets are being worked on. Pro-tip: If you are monitoring this via
SHOW BACKEND
or
SHOW PROC "/statistic"
, you will see the "TabletNum" on the new nodes increasing steadily as long as the scheduler has "slots" available under that 500-task limit. Referencesadministration/management/FE_configuration.mdfaq/operation_maintenance_faq.mdadministration/management/resource_management/Replica.md Referencesadministration/management/FE_configuration.mdfaq/operation_maintenance_faq.mdadministration/management/resource_management/Replica.md Referencesadministration/management/FE_configuration.md
p
Is one the lowest or can it take 0.1? @Rocky ADMIN SET FRONTEND CONFIG ("tablet_sched_max_scheduling_tablets" = "1");
r
No, it cannot take a decimal value like 0.1. The parameter
tablet_sched_max_scheduling_tablets
is defined as an Integer (Int) type. In StarRocks, configuration parameters of type
Int
must be whole numbers. If you try to pass a decimal, the command will either return an error or fail to parse correctly. Is "1" the lowest? Technically, 0 is the lowest value you can set, but as we discussed, setting it to
0
effectively kills all scheduling (both repairs and balancing). * Lowest functional value: 1. This limits the cluster to moving exactly one tablet at a time across the entire cluster. This is the "slowest" possible setting that still allows work to happen. * Absolute lowest value: 0. This stops all work. Why decimals aren't allowed This setting represents a count of individual units (tablets). Since you cannot move "one-tenth" of a tablet, the system only understands whole numbers. Recommendation If your goal is to make the balancing process as "invisible" and low-impact as possible: 1. Set it to
1
:
ADMIN SET FRONTEND CONFIG ("tablet_sched_max_scheduling_tablets" = "1");
2. Monitor the impact: If you still see too much IO, check
tablet_sched_max_balancing_tablets
as well, or look into
clone_max_network_bandwidth
(on the BE side) to limit the actual transfer speed in bytes per second rather than the number of tablets. Referencesadministration/management/FE_configuration.mdsql-reference/data-types/numeric/INT.mdadministration/management/BE_configuration.md Referencesadministration/management/FE_configuration.mdsql-reference/data-types/numeric/INT.mdadministration/management/BE_configuration.md Referencesadministration/management/FE_configuration.mdsql-reference/data-types/numeric/INT.mdadministration/management/BE_configuration.mdsql-reference/data-types/numeric/TINYINT.mdsql-reference/data-types/numeric/SMALLINT.md
p
@Rocky
clone_max_network_bandwidth
does not appear to be a real setting.
r
You are absolutely right. I apologize for that—I hallucinated the name of that specific parameter. The correct parameter to control the network speed of data movement (cloning/balancing) in StarRocks is
max_download_speed_kbps
(or
replication_max_speed_limit_kbps
in newer versions). Here are the actual settings you can use on the Backend (BE) nodes to throttle the bandwidth: 1.
max_download_speed_kbps
(BE Configuration)
This is the standard parameter used to limit the speed of data replica synchronization (cloning) between BE nodes. * Default:
50000
(which is ~50 MB/s). * Scope: This is a per-task (per HTTP request) limit. * How to set:
Copy code
sql
    -- Example: Limit each clone task to 10 MB/s
    UPDATE SET CONFIG ("max_download_speed_kbps" = "10240");
2.
replication_max_speed_limit_kbps
(BE Configuration - v3.3.5+)
In more recent versions, this parameter specifically targets the replication thread speed. * Default:
50000
(~50 MB/s). * Scope: Per replication thread. 3. Concurrency via Slots (FE Configuration) If you want to limit the pressure on the node as a whole rather than the raw speed of a single transfer, StarRocks uses a "slot" system. *
tablet_sched_slot_num_per_path
: This defines how many concurrent clone tasks a single disk (path) can handle. * Default:
2
. * If you have 10 disks and this is set to 2, the node can handle 20 concurrent transfers. Reducing this to
1
will further throttle the total impact on the node. Summary of the "Throttling" Toolkit If you want to move tablets as safely and slowly as possible, you would combine these: 1. FE:
tablet_sched_max_scheduling_tablets = 1
(Only 1 tablet moving in the whole cluster at a time). 2. BE:
max_download_speed_kbps = 5120
(Limit that one movement to 5 MB/s). Again, sorry for the confusion on the parameter name! Referencesadministration/management/BE_configuration.mdadministration/management/resource_management/Replica.mdadministration/management/FE_configuration.md Referencesadministration/management/BE_configuration.mdadministration/management/FE_configuration.md
p
@Rocky what does create_tablet_worker_count do?
r
create_tablet_worker_count
is a Backend (BE) configuration parameter that controls how many threads on each BE node are dedicated to processing new tablet creation requests from the Frontend (FE). Here is a breakdown of what it does and when it matters: 1. What it handles This worker pool is responsible for processing
TTaskType::CREATE
tasks. This happens in scenarios such as: * Creating new tables: When you run a
CREATE TABLE
statement. * Creating new partitions: When a new partition is added to an existing table (manually or via dynamic partitioning). * Schema Changes: When you add/drop columns or change types, the system often creates new "shadow" tablets to hold the restructured data. * Replica Repair/Balance: When the FE decides to create a new replica on a BE (to replace a dead one or balance the cluster), it first sends a "Create Tablet" task to that BE. 2. Why you would change it * Increasing it (e.g., to 10 or 20): Helpful if you are creating a massive number of tables or partitions simultaneously (e.g., a bulk migration) and you see "create tablet timeout" errors in the FE logs. It allows the BE to handle more creation requests in parallel. * Decreasing it (Default is 3): Throttles the BE if the creation of many tablets is causing too much metadata/IO contention on the node. 3. Key Differences from your previous questions It is important to distinguish this from the "movement" settings we discussed: *
tablet_sched_max_scheduling_tablets
(FE side):
Limits how many total tablet operations (moves/repairs) the entire cluster attempts at once. *
create_tablet_worker_count
(BE side):
Limits how many "Create" requests a single BE node can work on at any given moment. How to check or change it Since it is a BE configuration, you can change it at runtime without restarting the BE:
Copy code
sql
-- Change it on a specific BE
ADMIN SET FRONTEND CONFIG ("create_tablet_worker_count" = "8"); -- Note: This is actually a BE config, use the SET CONFIG command for BE
Actually, to set it on a BE, you use the
UPDATE
syntax:
Copy code
sql
UPDATE SET CONFIG ("create_tablet_worker_count" = "8");
Summary Profile:Default: 3 • Type: Int (Whole numbers only) • Mutable: Yes (Can be changed at runtime) • Location:
be.conf
(or via SQL
UPDATE SET CONFIG
) Referencesadministration/management/BE_configuration.mdfaq/Deploy_faq.mdadministration/management/FE_configuration.md Referencesadministration/management/BE_configuration.mdfaq/Deploy_faq.mdadministration/management/FE_configuration.md Referencesadministration/management/BE_configuration.md Referencesadministration/management/BE_configuration.mdfaq/Deploy_faq.mdadministration/management/FE_configuration.md
p
@Rocky explain to me this please drop_tablet_worker_count
r
drop_tablet_worker_count
is the Backend (BE) counterpart to the
create_tablet_worker_count
we just discussed. It controls the thread pool responsible for deleting (dropping) tablets from the physical disks. Here is the breakdown: 1. What it handles This worker pool processes
TTaskType::DROP
tasks. These tasks are triggered when: * Dropping a Table/Partition: When you run
DROP TABLE
or
ALTER TABLE... DROP PARTITION
. * Replica Cleanup: When a tablet is moved to a different node (balancing) or a redundant replica is deleted, the FE sends a command to the "old" BE node to delete its copy. * Schema Change Completion: After a successful schema change, the old version of the tablets are dropped. 2. The unique "0" Default Unlike most other worker counts, the default for
drop_tablet_worker_count
is 0. * Value = 0: This is a special setting that tells the BE to automatically use half of the CPU cores on the machine. * Example: If your BE node has 16 CPU cores, setting this to
0
will result in 8 threads dedicated to dropping tablets. 3. Why would you change it? * If Deletion is too slow: If you drop a massive table (e.g., thousands of partitions/tablets) and notice that disk space isn't being reclaimed quickly, or the FE is reporting "drop tablet timeout," you might increase this. * If Deletion causes IO Spikes: Physical file deletion is an IO-intensive task. If you find that dropping large tables causes your system's disk latency to spike (affecting query performance), you can change this from
0
to a small fixed number like
2
or
4
to throttle the speed at which files are unlinked from the OS. How to configure it Like other BE settings, you can update it at runtime:
Copy code
sql
-- Change it to 4 threads instead of the default "half of CPU cores"
UPDATE SET CONFIG ("drop_tablet_worker_count" = "4");
Summary Comparison Parameter | Task Type | Default Value
create_tablet_worker_count
| New tables/partitions |
3
drop_tablet_worker_count
| Deleting data/old replicas |
0
(Half of CPU cores)
alter_tablet_worker_count
| Schema changes (Add/Drop columns) |
3
Referencesadministration/management/BE_configuration.mdadministration/management/FE_configuration.md Referencesadministration/management/BE_configuration.mdfaq/operation_maintenance_faq.mdadministration/management/FE_configuration.mdsql-reference/sql-statements/loading_unloading/ETL/DROP_TASK.md
p
@Rocky For CNs in shared data mode does drop_tablet_worker_count apply?
r
The short answer is no. The parameter
drop_tablet_worker_count
does not apply to Compute Nodes (CNs) or BEs operating in Shared-Data (cloud-native) mode for the purpose of data deletion. Here is the technical breakdown of why: 1. Different Storage Engines * Shared-Nothing (Local Storage): Uses the OLAP engine. Tablets are stored as physical files on the BE's local disks. The
drop_tablet_worker_count
controls the threads that physically
unlink()
(delete) these tablet files from the local filesystem. * Shared-Data (Object Storage): Uses the Lake engine. Data is stored in object storage (S3, OSS, HDFS). CNs are essentially stateless and do not "own" tablet files on their local disks; they only maintain a local cache (Data Cache) of that remote data. 2. Who actually deletes the data in Shared-Data mode? In a Shared-Data cluster, when you run
DROP TABLE
, the deletion process is handled differently: * Metadata: The FE removes the tablet metadata from its internal catalog. * Physical Data: The physical files in S3/OSS are not deleted by the BE/CN workers. Instead, a background process in the FE (often called the
LakeCleaner
) identifies files that are no longer referenced by any metadata and issues the
DeleteObject
calls directly to the object storage. * Local Cache: The CN simply stops referencing the data. The local cache space is eventually reclaimed by the cache's LRU (Least Recently Used) eviction policy. 3. What if you want to speed up or throttle deletion in Shared-Data? Because the CN worker pool isn't involved, changing
drop_tablet_worker_count
won't help. Instead, you should look at these FE configurations: *
lake_service_max_concurrency
: Controls how many concurrent requests the FE can handle for shared-data operations. *
catalog_trash_expire_second
: (FE) Controls how long dropped items stay in the "recycle bin" before the FE starts the actual deletion from object storage. *
lake_enable_drop_tablet_cache
(v4.0+)
: This is a new FE setting that, when enabled, tells the FE to notify CNs to proactively clear their local cache when a tablet is dropped (rather than waiting for LRU eviction). Summary Table Feature | Shared-Nothing (BE) | Shared-Data (CN) Storage Location | Local Disks | Object Storage (S3/OSS/etc.) Worker Used |
drop_tablet_worker_count
| N/A (Handled by FE / Cache LRU) Physical Deletion | BE deletes local files | FE deletes objects from S3/OSS Throttling | Change BE Config | Change FE Metadata/Cleaner Config Rocky's Tip: If you are running a hybrid cluster (some tables are Shared-Nothing/OLAP and some are Shared-Data/Lake), the setting will only affect the deletion of the Shared-Nothing tables on the BE nodes. For a pure CN-based Shared-Data cluster, you can ignore this parameter entirely. Referencesadministration/management/BE_configuration.mdadministration/management/FE_configuration.mdfaq/shared_data_faq.mdknowledge/admin_and_operation/shared_data_compaction.mdadministration/management/compaction.md
p
@Rocky what is safe value for
lake_service_max_concurrency
if you want to throttle?
r
In a StarRocks Shared-Data (Cloud-Native) cluster,
lake_service_max_concurrency
is a Backend (BE) / Compute Node (CN) configuration parameter that acts as a circuit breaker for incoming metadata and task requests. What it does It limits the number of concurrent RPC (Remote Procedure Call) requests the "Lake Service" on a node can process at one time. This service handles critical shared-data operations such as: * Fetching/updating tablet metadata. * Triggering compaction tasks. * Handling version publishes from the FE. The "Safe" Value for Throttling Unlike some settings that "slow down" tasks, this parameter is a hard limit. If the concurrency exceeds this value, the node will reject new incoming requests, which can lead to query failures or load errors. * Default Value:
0
(Unlimited). This is the recommended setting for most clusters to ensure the FE can always communicate with the CNs. * Throttling Scenario: If you are experiencing CPU exhaustion or Out of Memory (OOM) issues on your CNs specifically due to a flood of metadata requests (common in clusters with millions of tablets or very high-frequency loading), you can set a limit. Recommended "Safe" Ranges if Throttling: 1. Conservative Throttling:
128
to
256
. This is usually enough to allow normal operations while preventing a "death spiral" where thousands of concurrent RPCs overwhelm the process memory. 2. Aggressive Throttling:
64
. Use this only if the node has very limited resources (e.g., < 8 CPU cores). Warning: Setting this value too low (e.g., < 32) is risky. If the FE cannot reach the Lake Service because the limit is hit, you will see errors like
RPC reach max concurrency
or
Service Busy
in your logs. Important Details * Location: This must be set in the
be.conf
or
cn.conf
file. * Mutability: It is not mutable at runtime (as of current versions). You must restart the BE/CN for the change to take effect. * Hierarchy: Before adjusting this, check your FE-side limits like
lake_compaction_max_tasks
(default -1/adaptive). It is often better to throttle the sender (FE) than to have the receiver (CN) reject requests. Summary Recommendation If you don't have a specific reason to throttle, leave it at 0. If you are seeing stability issues on CNs during high-concurrency metadata operations, start with 256 and monitor for "rejected" or "busy" errors in the FE
fe.warn.log
. Referencesadministration/management/BE_configuration.mdknowledge/admin_and_operation/shared_data_compaction.mdadministration/management/compaction.md Referencesadministration/management/BE_configuration.mdknowledge/admin_and_operation/shared_data_compaction.mdadministration/management/FE_configuration.mddeployment/environment_configurations.mdadministration/management/compaction.md
p
@Rocky when this error happens "starrocks-sql commissions_perf_summary_objective_table_UPDATED: ProgrammingError(1064, 'starlet err grpc.GetShard(shardId=13581) error: Deadline Exceeded: BE:94504')" what is the shardId its referencing?
r
In StarRocks Shared-Data (Cloud-Native) architecture, the
shardId
referenced in that error is synonymous with the Tablet ID. Here is a detailed breakdown of what that error message means: 1. What is the
shardId
?
In the shared-data engine (the "Lake engine"), StarRocks uses an internal component called Starlet to manage data. At this lower level, a Tablet is referred to as a Shard. *
shardId=13581
is the unique identifier for the specific tablet that the query was trying to access. * You can find which table and partition this belongs to by running this command in your SQL client:
Copy code
sql
    SHOW TABLET 13581;
2. What does "Deadline Exceeded" mean? This is a gRPC timeout error. It means the requester (likely the BE/CN or the FE) waited for the metadata of that shard/tablet for too long, and the request timed out. * In Shared-Data mode, metadata is often managed by the StarMgr (Star Manager) service within the FE. * If the FE is under heavy load, or if there is a network bottleneck between the BE and the FE, the
GetShard
RPC call (which fetches the tablet's location and version info) fails. 3. What is "BE:94504"? In this context,
94504
is likely the Backend ID of the node that encountered the error or was being contacted. It is not a port number (ports only go up to 65535). You can identify which node this is by running:
Copy code
sql
SHOW BACKENDS; -- or SHOW COMPUTE NODES;
Look for the node where
BackendId
(or
NodeId
) is
94504
. Why is this happening? Common causes for this specific error include: * High FE Load: The FE's StarMgr module is too busy to respond to metadata requests. Check the FE CPU and the
starmgr_grpc_server_max_worker_threads
setting. * Network Latency: High latency between your CN/BE nodes and the FE nodes. * Object Storage Latency: If the "Starlet" service on the CN is trying to fetch shard headers from S3/OSS and the object store is responding slowly, it can trigger a deadline timeout. * Large Metadata: If the table has a massive number of tablets or versions, the metadata requests become heavier. How to troubleshoot: 1. Locate the Tablet: Run
SHOW TABLET 13581;
to see which table is affected. 2. Check FE Health: Look at
fe.log
and
fe.warn.log
around the time of the error for "StarMgr" or "gRPC" related warnings. 3. Check CN/BE Health: Check the
<http://be.INFO|be.INFO>
log on the node with ID
94504
. 4. Configuration: If this happens frequently under high load, you may need to increase the timeout in `fe.conf`:
Copy code
properties
    starmgr_grpc_timeout_seconds = 10  # Default is usually 5
Rocky's Tip: If you see this during a large
UPDATE
or
INSERT
operation, it usually points to "version exhaustion" or too many small files being created, which puts pressure on the metadata service (Starlet/StarMgr). Referencesfaq/shared_data_faq.mdadministration/management/FE_configuration.mdfaq/Deploy_faq.mdfaq/Sql_faq.mddeployment/shared_data/gcs.md
p
@Rocky I see this during Tablet rebalancing.
r
This error is a classic gRPC timeout occurring within the Starlet service (the internal metadata and storage manager for Shared-Data mode). When you see this specifically during Tablet Rebalancing, it indicates that the system is trying to move or sync tablet assignments across your Compute Nodes (CNs), but the metadata requests are being queued or delayed longer than the allowed limit. 1. What is the
shardId
and
BE:94504
?
*
shardId=13581
: In Shared-Data mode, a "Shard" is the internal term for a Tablet. This is the unique ID of the data tablet that the system failed to access. You can identify the table it belongs to by running:
Copy code
sql
    SHOW TABLET 13581;
*
BE:94504
: This is the Backend ID (or Node ID) of the Compute Node that encountered the timeout. Since this is an ID and not a port, you can find the specific node by running:
Copy code
sql
    SHOW BACKENDS; -- or SHOW COMPUTE NODES;
Look for the row where
BackendId
(or
NodeId
) is
94504
. 2. Why does this happen during Rebalancing? In Shared-Data mode, rebalancing (triggered by
lake_enable_balance_tablets_between_workers
) doesn't move physical files (since they are in S3), but it moves the "ownership" or "responsibility" of tablets between CNs to balance the query load and data cache. During this process: 1. The FE sends many
GetShard
or
UpdateShard
RPC calls to the CNs. 2. If you have a high number of tablets, the gRPC worker queue on either the FE (StarMgr) or the CN (Starlet) can become saturated. 3. The default timeout for these internal metadata calls is often only 5 seconds (
starmgr_grpc_timeout_seconds
). If the request waits in the queue for 5.1 seconds, you get the "Deadline Exceeded" error. 3. How to fix or throttle this To stop these errors during rebalancing, you should increase the tolerance for metadata latency and ensure the metadata service has enough threads. Step A: Increase the FE Metadata Timeout This is the most direct fix. Increase the time the FE/CN will wait for a shard metadata response. * Parameter:
starmgr_grpc_timeout_seconds
(in
fe.conf
) * Recommendation: Increase from
5
to
15
or
30
.
Copy code
sql
    ADMIN SET FRONTEND CONFIG ("starmgr_grpc_timeout_seconds" = "20");
Step B: Increase Metadata Worker Threads If your FE is under heavy load, it might not be processing the
GetShard
requests fast enough. * Parameter:
starmgr_grpc_server_max_worker_threads
(in
fe.conf
) * Recommendation: If your FE has many cores, increase this from the default (usually 32) to
128
or
256
. Step C: Throttling the Rebalancing (v3.3.4+) If the rebalancing is too aggressive and affecting your queries, you can temporarily disable it or check the scheduling parameters. * To Disable:
ADMIN SET FRONTEND CONFIG ("lake_enable_balance_tablets_between_workers" = "false");
* To Throttling: Check
tablet_sched_slot_num_per_path
(FE config). Although this is originally for Shared-Nothing, the Starlet scheduler uses similar logic to limit concurrent tasks. Summary Checklist 1. Identify the Node: Use
SHOW BACKENDS
to find which node is
94504
. Check if its CPU or Network is pinned. 2. Increase Timeouts: Set
starmgr_grpc_timeout_seconds
to
20
in the FE. 3. Check Tablet Count: If you have millions of tablets, rebalancing will always be "heavy." Consider increasing your bucket size for future tables to reduce the total tablet count. Rocky's Tip: If you see this error alongside "Service Busy," it means the
lake_service_max_concurrency
limit you asked about earlier is being hit. But since you are seeing "Deadline Exceeded," it’s more likely a latency/timeout issue than a hard concurrency rejection. Referencesfaq/Sql_faq.mdfaq/operation_maintenance_faq.md
p
@Rocky I've already increased these: starmgr_grpc_timeout_seconds = 120 starmgr_grpc_server_max_worker_threads = 4096 star_client_read_timeout_seconds = 120
r
The error you are seeing—`starlet err grpc.GetShard ... Deadline Exceeded: BE:94504`—is a strong signal that your Compute Nodes (CN/BE) are overwhelmed by metadata requests during the rebalancing process. Even though you have increased the FE-side timeouts and threads to 120s and 4096, the bottleneck has shifted (or remains) on the Backend/Compute side, specifically at the Lake Service level. 1. What is a "Safe" value for
lake_service_max_concurrency
?
This parameter (in
be.conf
or
cn.conf
) limits the number of concurrent RPC requests the Lake Service on that node will process. * Default:
0
(Unlimited). This is often the cause of "Deadline Exceeded" because the node attempts to handle thousands of requests (like
GetShard
,
PublishVersion
,
Compact
) simultaneously, causing thread starvation or deep queuing. * Recommended Throttling Value:
256
to
512
. * Why this value? * Setting it to
256
ensures that the node only works on 256 metadata tasks at once. * If the FE sends more, the BE will immediately reject them with a "Service Busy" (or similar) error. * "Service Busy" is better than "Deadline Exceeded" because it prevents the gRPC threads from hanging for 120 seconds, allowing the system to recover much faster and the FE to retry gracefully. 2. Deep Dive: Why is
GetShard
timing out during rebalancing?
During tablet rebalancing, the FE tells CNs to take responsibility for new tablets. To do this, the CN must call
GetShard
(internally part of the Starlet/StarMgr protocol) to fetch the tablet's metadata. If you are still hitting 120-second timeouts, the issue is likely one of the following: A. Lock Contention (Most Likely) If you have a high number of tablets, the internal "Tablet Map" on the BE becomes a hotspot. * Fix: Increase the shard size for the internal maps in
be.conf
(requires restart): *
tablet_map_shard_size = 2048
(Default 1024, must be power of 2) *
pk_index_map_shard_size = 8192
(If using Primary Key tables, default 4096) B. Object Storage Latency In Shared-Data mode,
GetShard
often requires the BE to read the "Shard Header" or metadata from S3/GCS. If your object storage is experiencing high latency or if the BE's network is saturated, these gRPC calls will sit and wait. * Action: Monitor your S3/Object Storage "First Byte" latency during the rebalancing window. C. Too many Metadata Threads Setting
starmgr_grpc_server_max_worker_threads = 4096
is extremely high. While it prevents the "Service Busy" rejection, it can lead to massive CPU context switching overhead on the FE, which actually slows down the response time of each individual request, eventually leading to a timeout anyway. * Recommendation: Scale this back to
512
or
1024
and use
lake_service_max_concurrency
on the BEs to back-pressure the system. 3. Immediate Mitigation Steps If the cluster is currently unstable due to rebalancing, run these commands: 1. Stop Rebalancing:
Copy code
sql
    ADMIN SET FRONTEND CONFIG ("lake_enable_balance_tablets_between_workers" = "false");
2. Apply Throttling (BE side): Add
lake_service_max_concurrency = 256
to your
be.conf
and restart the nodes one by one. 3. Check Tablet Counts: If your
shardId
values are very high, you might have too many small tablets. Check your
BUCKETS
configuration. A high tablet count makes rebalancing much more expensive. Summary of Safe Values for Throttling: Parameter | Conservative | Aggressive
lake_service_max_concurrency
|
512
|
128
starmgr_grpc_timeout_seconds
|
30
|
10
starmgr_grpc_server_max_worker_threads
|
512
|
256
Referencesadministration/management/FE_configuration.mdquick_start/shared-nothing.md
p
@Rocky is parallel_clone_task_per_path a shared-data or shared-nothing parameter?
r
parallel_clone_task_per_path
is a Shared-Nothing architecture parameter. In StarRocks, the concept of a "Clone Task" refers to the physical copying of tablet data from one Backend (BE) to another to maintain the desired number of replicas or to rebalance data across disks. This is a core mechanism of the Shared-Nothing (classic) architecture. Here is why it does not apply to Shared-Data: 1. Architectural Difference * Shared-Nothing: Data is stored on local BE disks. If a node fails or a disk becomes unbalanced, the FE schedules a "Clone Task" to copy the tablet files from a healthy node to a new one.
parallel_clone_task_per_path
limits how many of these copies can happen simultaneously per disk. * Shared-Data: Data is stored in centralized object storage (S3/OSS/GCS). When you "rebalance" or "repair" in Shared-Data mode, StarRocks does not physically copy tablet files between nodes; it simply updates the metadata (in StarMgr/Starlet) to tell a different Compute Node (CN) to take responsibility for that tablet's cache and metadata. 2. Local Storage Usage * The parameter name includes
_per_path
, referring to the
storage_root_path
defined in your BE config. * In Shared-Nothing, these paths are for permanent data storage. * In Shared-Data, local paths are typically used only for Data Cache. While there is internal management of this cache, it is governed by
lake_
prefixed parameters (like
lake_enable_balance_tablets_between_workers
) rather than the standard replica cloning logic. 3. Verification If you are running a Shared-Data cluster and see rebalancing issues, the parameters you should look at instead are: *
lake_service_max_concurrency
(BE/CN side): Throttles metadata/task handling. *
tablet_sched_slot_num_per_path
(FE side): Even in shared-data, the FE uses "slots" to schedule tasks, though the tasks themselves are different. *
starmgr_grpc_timeout_seconds
(FE side): As discussed previously, to handle metadata latency. Rocky's Summary: If you are tuning a Shared-Data cluster, you can ignore
parallel_clone_task_per_path
. It will have no effect on your Cloud-Native tablet rebalancing. Referencesadministration/management/BE_configuration.mdadministration/management/resource_management/Replica.mddeployment/shared_data/feature-support-shared-data.mddeployment/shared_data/azure.mddeployment/shared_data/hdfs.mddeployment/shared_data/gcs.mdadministration/management/monitoring/metrics.md
p
@Rocky setting
lake_service_max_concurrency
to
512
and
starmgr_grpc_server_max_worker_threads
to 512 didn't prevent the errors.
r
If increasing the timeouts and thread counts to 120s and 512 didn't stop the errors, it means the issue isn't just a "small queue" or "short wait." It indicates that the target node (BE:94504) is either genuinely stuck or so overwhelmed that it cannot complete a metadata request even within two minutes. In Shared-Data mode, rebalancing involves the FE changing tablet ownership and the CN (Compute Node) loading the tablet's metadata from object storage (S3/OSS). If you have a high tablet count, this creates a "metadata storm." Here are the next steps to resolve this, moving from throttling the load to optimizing the node's internal handling: 1. Slow down the FE Rebalancer The FE scheduler might be pushing too many rebalancing tasks at once. Even though it's Shared-Data, the FE still uses the
TabletScheduler
. * Parameter:
tablet_sched_max_balancing_tablets
(FE config) * Action: Lower this from the default
500
to
50
or
100
.
Copy code
sql
    ADMIN SET FRONTEND CONFIG ("tablet_sched_max_balancing_tablets" = "50");
This slows down the rebalancing speed, giving the CNs more "breathing room" to process each
GetShard
request. 2. Lower (don't raise)
lake_service_max_concurrency
Setting this to
512
allows 512 metadata tasks to run simultaneously on a single node. If these tasks are all competing for the same internal locks or waiting on S3 latency, they will all eventually time out. * Recommendation: Try lowering this to
64
or
128
in
be.conf
. * Why: This forces the node to reject excess requests immediately ("Service Busy") instead of accepting them and letting them sit in a queue until they hit the 120s "Deadline Exceeded" limit. 3. Reduce Internal Lock Contention (BE/CN side) If you have millions of tablets, the internal "Tablet Map" can become a bottleneck during mass rebalancing. * Parameter:
tablet_map_shard_size
(in
be.conf
) * Action: Increase this to
2048
or
4096
(must be a power of 2). This splits the internal tablet lock into more shards, reducing the chance of gRPC threads blocking each other.
Copy code
properties
    tablet_map_shard_size = 2048
(Requires a restart of the CN/BE). 4. Check for Object Storage "First Byte" Latency In Shared-Data mode,
GetShard
often requires the CN to read a small metadata file from S3. If your S3-compatible storage is experiencing high latency (e.g., due to request rate limits), the CN's gRPC handlers will hang. * Check: Look at your object storage monitoring for any spikes in
5xx
errors or
TotalTime
during the rebalancing window. 5. Check the Health of Node 94504 Since the error specifically names
BE:94504
, check that specific node: * CPU usage: Is it pinned at 100%? If so, the gRPC threads may not be getting scheduled. * Memory/OOM: Check
dmesg
or the
be.out
log to see if the node is hitting OOM limits, which causes frequent pauses. * Disk I/O: Even in Shared-Data, StarRocks uses local disk for the Data Cache. If the cache disk is failing or extremely slow, it can block metadata operations. Summary Recommendation 1. FE:
ADMIN SET FRONTEND CONFIG ("tablet_sched_max_balancing_tablets" = "50");
2. BE: Set
lake_service_max_concurrency = 128
and
tablet_map_shard_size = 2048
. 3. Monitor: Run
SHOW BACKENDS
and check the
TabletNum
column for node
94504
. If the number is changing very rapidly, the rebalancing is likely too aggressive for that node's current resources. Referencesadministration/management/FE_configuration.mdknowledge/admin_and_operation/shared_data_compaction.md
p
@Rocky what does report_tablet_interval_seconds do? what happens if I lower this value?
@Rocky what does report_tablet_interval_seconds do? what happens if I lower this value?
r
report_tablet_interval_seconds
is a Backend (BE) configuration parameter that controls how often the BE node sends a full report of its tablet metadata to the Frontend (FE). What it does: * Version Synchronization: The BE uses this interval to tell the FE the latest version and status of every tablet replica it currently hosts. * Metadata Consistency: This is the "ground truth" mechanism that ensures the FE's metadata (which it uses to plan queries and schedule tasks) matches what is physically on the disks (in Shared-Nothing) or assigned to the node (in Shared-Data). * Default: Usually 60 seconds. ────────── What happens if you lower this value? If you reduce this value (e.g., from 60s to 10s): 1. Faster Metadata Updates (The Benefit) The FE will find out much faster when a tablet has been successfully created, dropped, or updated to a new version. This can slightly speed up the time it takes for a cluster to realize a "Repair" or "Balance" task is complete. 2. Increased CPU & Network Load (The Risk) Lowering this value increases the frequency of "Report" tasks. Each report requires the BE to scan its internal tablet map and send a potentially large gRPC packet to the FE. * On the BE: Increased background CPU usage. * On the FE: The Master FE must process these reports from all BEs. If you have a large cluster with millions of tablets, the FE's
ReportHandler
can become a major bottleneck, leading to high FE CPU usage and lock contention. 3. Relation to your "Deadline Exceeded" Errors In your specific case (Shared-Data rebalancing), lowering this value is likely to make your errors WORSE. Since you are already hitting gRPC timeouts and "Deadline Exceeded" errors, your FE and CN/BEs are already struggling to keep up with metadata traffic. _ If you lower this interval, you are adding _more* frequent, large metadata synchronization tasks to a system that is already timing out. * This will likely increase the "Metadata Storm," causing even more gRPC requests to time out or be rejected. Rocky’s Recommendation: * Don't lower it while troubleshooting rebalancing issues. In fact, in very large clusters experiencing metadata pressure, we often increase this value (e.g., to
120
or
300
) to reduce the background noise and let the FE focus on processing high-priority tasks like
GetShard
or
PublishVersion
. * If you want to speed up rebalancing, focus on the parameters discussed earlier (throttling the number of tasks) rather than the reporting frequency. Check the current value in your BEs: You can verify the current setting by running:
Copy code
sql
SHOW BACKEND CONFIG LIKE 'report_tablet_interval_seconds';
Referencesadministration/management/FE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/BE_configuration.md
report_tablet_interval_seconds
is a Backend (BE/CN) configuration parameter that controls how often each node sends a full status report of its tablets to the Frontend (FE). What does it do? Every $X$ seconds (default: 60), the BE scans its internal metadata and sends a report to the FE Leader. This report includes: * Which tablets the BE is currently hosting. * The version of each tablet. * The health/status of those tablets. The FE uses this information to keep its
TabletInvertedIndex
(the "global map" of where data is) up to date. This is critical for the FE to know if a replica is healthy, if it has the latest data for a query, or if a rebalancing task has successfully finished. ────────── What happens if you lower this value? (e.g., from 60s to 10s) The "Pros" (Why you might do it): 1. Faster Recovery/State Sync: If a node was down and comes back up, or if you just added a new node, the FE will discover the tablets on that node much faster. 2. Quicker Rebalancing Feedback: During a rebalance, the FE waits for the BE to report that it has "received" the new tablet. A lower interval means the FE realizes the task is done sooner and can move on to the next one. The "Cons" (Why it's dangerous in your current situation): Given that you are already hitting "Deadline Exceeded" and gRPC timeout errors, lowering this value is likely to make your situation worse. 1. Increased RPC Traffic: If you have 1 million tablets and 10 BEs, each BE has to serialize a large list of tablet IDs and versions and send it to the FE. Doing this every 10 seconds instead of 60 seconds significantly increases the network and CPU load. 2. FE Metadata Lock Contention: The FE must acquire a lock to update its global tablet map. If all your BEs start reporting 6 times more frequently, the FE Leader will spend a massive amount of its CPU time just processing these reports, potentially blocking query planning or other management tasks. 3. Worsening gRPC Congestion: You are already seeing timeouts on
GetShard
and other StarMgr calls. Adding frequent, heavy "Tablet Report" RPCs to the same gRPC thread pool will cause even more queuing and more "Deadline Exceeded" errors. ────────── Rocky’s Advice for Your Case: Since you are currently struggling with rebalancing stability: * DO NOT lower this value. If anything, during a heavy rebalance where the system is "metadata-saturated," some users temporarily increase it to 120 or 300 seconds to reduce the background noise while the system moves data. * Check the FE side instead: If you feel the FE is too slow to realize rebalancing is happening, look at
tablet_sched_max_balancing_tablets
(as mentioned before) to control the concurrency of the tasks, rather than the reporting frequency. Recommendation: Keep
report_tablet_interval_seconds
at 60. If your FE
TabletInvertedIndex
seems stuck for a long time, check the FE logs for
report_tablet
to see if the FE is actually failing to process the reports because it's too busy. Referencesadministration/management/BE_configuration.mdadministration/management/FE_configuration.mdadministration/management/resource_management/Replica.mdadministration/management/monitoring/metrics.mdadministration/management/BE_configuration.mddeployment/shared_data/feature-support-shared-data.mdadministration/management/BE_configuration.md
administration/management/FE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.md
administration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.md
administration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.md
administration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.md
administration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.md
administration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.md
administration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.md
administration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.md
administration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.mdadministration/management/BE_configuration.mdadministration/management/monitoring/metrics.mdadministration/management/FE_configuration.md
p
@Rocky how do I check this index and logs? "If your FE
TabletInvertedIndex
seems stuck for a long time, check the FE logs for
report_tablet
to see if the FE is actually failing to process the reports because it's too busy."
r
Checking the
TabletInvertedIndex
and the tablet reporting process requires a mix of looking at FE log files and analyzing the FE process's internal thread state. Since this is an internal memory structure, there isn't a simple SQL command like `SELECT * FROM internal_index`; instead, you observe its activity. 1. How to check FE Logs for
report_tablet
The FE Leader is responsible for receiving and processing reports from all BE/CN nodes. To see if it's struggling, grep your
fe.log
(and
fe.warn.log
) for these keywords:
Copy code
bash
# Search for tablet report processing start/end
grep -E "receive report from|finished processing report" fe.log

# Look for specific mentions of the ReportHandler thread
grep "ReportHandler" fe.log
What to look for: * Processing Time: Look for messages like
finished processing report from backend [10001]. cost: 5000 ms
. If the "cost" is very high (e.g., several seconds or more) or if it's consistently increasing, the FE is being overwhelmed by the number of tablets. * Gaps in Reporting: If you see
receive report from [10001]
but no corresponding
finished processing
for a long time, the thread is likely stuck behind a lock. * Frequency: Check the timestamps. If you expect a report every 60 seconds (default), but you only see them every 300 seconds, the reporting queue is backed up. ────────── 2. How to check the
TabletInvertedIndex
state
The
TabletInvertedIndex
is often the "victim" of lock contention. If it's "stuck," it usually means the ReportHandler thread is waiting for a lock on the
LocalMetastore
(Database lock) or vice-versa. The best way to verify this is using
jstack
on the FE process:
Copy code
bash
# Find the FE process ID
ps aux | grep StarRocksFE

# Capture a thread dump
jstack -l <FE_PID> > fe_stack.txt

# Search for the ReportHandler thread in the output
grep -A 20 "ReportHandler" fe_stack.txt
What to look for in the stack trace: *
WAITING (parking)
or `BLOCKED`:
If the
ReportHandler
thread is in this state, look at what it's waiting for. * Lock Contention: If you see
at com.starrocks.catalog.TabletInvertedIndex.tabletReport
, it confirms the report processing is currently active but potentially slow or waiting for a Database read/write lock. ────────── 3. Monitoring via
SHOW PROC
While you can't see the index itself, you can see if the FE thinks its metadata is healthy: *
SHOW PROC '/statistic';
: Check the
UnhealthyTabletNum
. If this is high and not decreasing during a rebalance, the FE's internal index isn't getting updated correctly by the reports. *
SHOW PROC '/backends';
: Check the
LastStartTime
and
TabletNum
. If
TabletNum
is
0
or not changing on a node you know has data, the FE has likely not processed a successful report from that node recently. Summary Checklist: 1. Slow Reports? Check
fe.log
for
cost: XXX ms
in
finished processing report
. 2. Thread Stuck? Use
jstack
to see if
ReportHandler
is
BLOCKED
. 3. Metadata Syncing? Use
SHOW PROC '/statistic'
to see if the system is actually making progress on cleaning up "Inconsistent" or "Unhealthy" tablets. If you find that reports are taking too long (e.g., > 10 seconds per BE), the best fix is usually to reduce the rebalancing concurrency (
tablet_sched_max_balancing_tablets
) rather than changing the report intervals. Referencesadministration/management/FE_configuration.mdknowledge/trouble_shooting/fe_deadlock_problems.md
p
@Rocky how do I make the Starlet service handle less RPC calls when new CN joins?
r
To reduce the pressure on the Starlet service (and the associated StarMgr/Lake services) when a new CN joins, you need to throttle the FE Tablet Scheduler. In Shared-Data mode, adding a node doesn't move data blocks, but it triggers a "metadata migration" where the FE reassigns tablet ownership. This causes a flood of RPC calls to the new CN to "load" these tablets. Here is how to make the system handle fewer concurrent calls: 1. Throttle the FE Rebalancer (The "Generator" of calls) The FE is what initiates the rebalancing. You should lower the global and per-node concurrency of the rebalancer. Run these on the FE: * Reduce Global Balancing Concurrency: The default is
500
. Lowering this to
20
or
50
significantly reduces the number of tablets being moved at the same exact moment.
Copy code
sql
    ADMIN SET FRONTEND CONFIG ("tablet_sched_max_balancing_tablets" = "50");
* Reduce Per-Node Concurrency (Slots): The scheduler uses "slots" to limit how many tasks are sent to a single node. Lowering this will force the FE to wait for earlier tasks to finish before sending more RPCs to the same CN.
Copy code
sql
    ADMIN SET FRONTEND CONFIG ("schedule_slot_num_per_path" = "2");
2. Configure the CN to Reject Excess Calls If the FE is still too aggressive, you can set a hard limit on the CN side using the parameter you mentioned earlier. Instead of a high number like 512, set it to a low, manageable number. * Parameter:
lake_service_max_concurrency
(in
cn.conf
) * Action: Set this to
32
or
64
. * Result: When the FE sends the 65th concurrent request, the CN will immediately return a "Service Busy" error. This prevents the gRPC queue from growing so long that requests hit the "Deadline Exceeded" timeout. 3. Temporarily Disable Rebalancing If the cluster is currently unstable because a new CN just joined, you can stop the storm entirely, let the system stabilize, and then re-enable it with the lower limits mentioned above.
Copy code
sql
-- Disable balancing
ADMIN SET FRONTEND CONFIG ("tablet_sched_disable_balance" = "true");

-- Wait for existing RPCs to clear, then re-enable with lower limits
ADMIN SET FRONTEND CONFIG ("tablet_sched_max_balancing_tablets" = "20");
ADMIN SET FRONTEND CONFIG ("tablet_sched_disable_balance" = "false");
4. Adjust StarMgr Worker Threads on FE When the Starlet service on the CN receives a request, it often has to call back to the StarMgr on the FE to verify shard metadata. If you have many CNs calling the FE at once, the FE's StarMgr can become the bottleneck. * Parameter:
starmgr_grpc_server_max_worker_threads
(FE config) * Advice: You previously set this to
512
. If the FE is struggling (check
fe.log
for StarMgr timeouts), ensure the FE has enough CPU to handle these threads. If the FE CPU is pinned, lower this to
128
to force the CNs to wait, rather than overwhelming the FE. Summary of Recommended "Safe" Joining Config: Configuration | Level | Recommended Value
tablet_sched_max_balancing_tablets
| FE |
20
to
50
schedule_slot_num_per_path
| FE |
2
lake_service_max_concurrency
| CN |
64
starmgr_grpc_server_max_worker_threads
| FE |
128
to
256
By lowering these values, the rebalancing will take longer to complete, but it will prevent the "Deadline Exceeded" and gRPC queue errors that crash or hang your nodes. Referencesadministration/management/FE_configuration.mdadministration/management/resource_management/Replica.mdfaq/operation_maintenance_faq.md
p
@Rocky what happens if lake_service_max_concurrency is 1? What is main risk?
r
Setting
lake_service_max_concurrency
to 1 is an extreme setting that effectively turns your multi-threaded Lake Service into a single-threaded bottleneck. In a StarRocks shared-data (lake) cluster, the Lake Service on the CN/BE node handles critical RPC requests including: * Data Reading: Every query fragment reading from a Lake table. * Metadata Management: Creating, dropping, or rebalancing tablets. * Tablet Version Sync: Checking if a local cache is up to date with the remote storage. * Compaction: Background merging of data files. What happens if it is set to 1? If this value is 1, only one single RPC request can be processed by that node at any given time. Every other incoming request from the FE or other nodes will be immediately rejected with a "Service Busy" or "Service Unavailable" error. The Main Risks 1. Total Query Failure (Paralysis) If a single user is running a query that requires reading data, it will occupy that one slot. Any other queries (even small metadata checks) will fail instantly. In a real-world scenario where a query might involve dozens of parallel scanners, a setting of 1 will cause most scan tasks to be rejected, leading to query timeouts or "Internal Error" messages. 2. Rebalancing "Infinite Loop" When a new CN joins, the FE tries to assign it thousands of tablets. Each assignment is an RPC call. If the concurrency is 1: * The FE sends 100 requests. * The CN accepts 1 and rejects 99. * The FE retries the 99, but the 1st one might still be processing. * The rebalancing progress will crawl at a snail's pace, potentially taking days instead of minutes. 3. Heartbeat and Metadata Timeouts The FE needs to regularly communicate with the Lake Service to ensure the node is healthy and metadata is consistent. If a long-running read or compaction task holds that single slot, the FE's heartbeat or "Get Tablet Info" calls will be rejected. This might cause the FE to incorrectly mark the node as
DEAD
or
OFFLINE
, leading to more cluster instability. 4. Deadlocks In complex operations, a task might wait for a secondary internal resource. If that secondary resource requires a separate RPC call to verify a state, and the only available concurrency slot is already occupied by the waiting task, the node could effectively hang (deadlock). Rocky’s Recommendation Never set this to 1 in a production environment. If you are trying to "throttle" the node because it is overwhelmed during a node-join: * Minimum "Safety" Value: Use at least 32 or 64. This allows enough "breathing room" for background metadata tasks and heartbeats to pass through while still limiting heavy data-moving tasks. * Better Approach: Control the concurrency from the FE side using
tablet_sched_max_balancing_tablets
(default 500, try 20-50). It is much safer to tell the FE to "send less work" than to tell the CN to "reject almost all work." Summary: Setting it to 1 will cause constant
Service Busy
errors and will likely crash your cluster's ability to plan queries or balance data. Referencesadministration/http_interface.md
p
@Rocky is there anyway to configure starmgr_client_rpc_timeout_ms on CNs?
r
There is no configuration parameter exactly named
starmgr_client_rpc_timeout_ms
in the StarRocks documentation for Compute Nodes (CNs). It is likely you are referring to a similarly named parameter in the FE configuration or a combination of parameters that control the RPC behavior between CNs and the FE's StarMgr service. In StarRocks Shared-Data (lake) mode, the CN acts as a client that communicates with the StarMgr (running on the FE). If you are seeing RPC timeouts on the CN when it tries to talk to the FE, here are the correct ways to configure those timeouts: 1. The FE-side Configuration (Most Likely) The primary parameter governing the gRPC timeout for the StarMgr service is located in the
fe.conf
. Even though the CN is the "client," the FE dictates the default processing timeout for these requests. * Parameter:
starmgr_grpc_timeout_seconds
(in
fe.conf
) * Default:
5
(seconds) * How to change:
Copy code
bash
    # In fe.conf
    starmgr_grpc_timeout_seconds = 30
(Note: This uses seconds, not milliseconds). 2. General RPC Timeouts (CN/BE side) If you want to adjust how long a CN/BE waits for any Thrift or bRPC call to the FE (including metadata and transaction operations), you use these in `cn.conf`: *
thrift_rpc_timeout_ms
: Sets the default timeout for Thrift-based RPC calls (default is usually
5000
ms). *
txn_commit_rpc_timeout_ms
: Specifically for transaction commit calls (default
60000
ms). 3. Starlet Internal Configuration (Advanced) StarRocks uses an internal library called Starlet for cloud-native orchestration. While not typically documented for end-users, you can sometimes pass internal Starlet parameters through the
cn.conf
using a
starlet_
prefix if you are directed to do so by support. However, there is no
starmgr_client_rpc_timeout_ms
. If you are trying to resolve "Deadline Exceeded" or "Service Busy" errors when a CN joins, you should focus on the following instead: 1. Lower the pressure on the FE: Increase
starmgr_grpc_server_max_worker_threads
in
fe.conf
(e.g., to
512
or
1024
) so the FE can handle more concurrent calls from the CNs. 2. Increase the FE timeout: Set
starmgr_grpc_timeout_seconds = 30
in
fe.conf
. 3. Throttle the CN: Ensure
lake_service_max_concurrency
(in
cn.conf
) is set to a reasonable value (like
64
or
128
) to prevent the node from being overwhelmed by too many simultaneous tasks during the joining phase. Summary If you were told to look for a
ms
timeout for the StarMgr client, check if you meant: •
starmgr_grpc_timeout_seconds
(in
fe.conf
) •
thrift_rpc_timeout_ms
(in
cn.conf
) If you are seeing specific "starmgr" errors in your CN logs, please share the error message, and I can help you identify the exact parameter causing the block! Referencesadministration/management/FE_configuration.mdadministration/management/BE_configuration.md