Mohan
08/21/2026, 10:57 AMRocky
08/21/2026, 10:58 AMpipeline_dop variable controls the degree of parallelism for query execution. Setting it to a fixed value (like half the vCPUs) instead of the default 0 has the following impacts on scans, joins, and overall operations:
1. Disabling Adaptive DOP
* Default (0): StarRocks uses Adaptive DOP. The system automatically adjusts parallelism based on the query's complexity and the number of tablets involved. For small queries or point lookups, it uses a lower DOP to save resources. For heavy queries, it scales up to a maximum (usually half the number of physical CPU cores).
* Fixed (Half vCPU): Forcing a fixed value disables this adaptivity. Every query—even a tiny one—will attempt to spawn the specified number of parallel pipeline instances.
2. Impact on Table Scans
* Tablet Utilization: If you set pipeline_dop to a value higher than the number of tablets being scanned, some parallel threads will be idle, but you still pay the "cost" of thread scheduling and resource allocation.
* Query Cache: StarRocks' Query Cache (for version 3.0+) may not work if the number of tablets being processed is smaller than the pipeline_dop. Setting a fixed high DOP can prevent the cache from being utilized for smaller tables.
* Small Scans: Simple scans will incur higher overhead due to the management of many unnecessary parallel instances, potentially increasing latency for "fast" queries.
3. Impact on Joins
* Latency vs. Throughput: A high fixed DOP can reduce the latency of a single large join by using more CPU cores for the build and probe phases. However, in a multi-user environment, this significantly reduces total cluster throughput.
* CPU Contention: If every concurrent query forces half the vCPUs to be used, the CPU will quickly become saturated. This leads to frequent context switching and "CPU starvation," where queries spend more time waiting for CPU cycles than doing actual work.
4. Physical Cores vs. vCPUs
* StarRocks typically calculates its internal default based on physical CPU cores. On most cloud instances, 1 physical core = 2 vCPUs.
* If the default 0 resolves to half the physical cores (e.g., 8 on a 32-vCPU machine), setting it manually to "half the vCPUs" (16) doubles the parallelism compared to the system's recommendation. This can lead to excessive memory consumption for hash tables during joins.
Summary Comparison
Feature | pipeline_dop = 0 (Default) | pipeline_dop = half vCPU (Fixed)
Adaptivity | High. Scales based on query size. | None. Fixed for all queries.
Small Queries | Efficient; low overhead. | High overhead; unnecessary threads.
Large Joins | Uses max available (up to 1/2 cores). | Forced high parallelism; faster in isolation.
Concurrency | Better; allows more simultaneous queries. | Poorer; risks CPU exhaustion.
Query Cache | Optimized automatically. | May break for small tablet counts.
Recommendation:
Keep pipeline_dop at 0. Only set it to a fixed value if you are tuning a specific, isolated batch job or if you need to limit parallelism (e.g., pipeline_dop = 1) to maximize concurrency for a high-TPS point-lookup workload.
References
• sql-reference/System_variable.md
• faq/Others.md
• deployment/plan_cluster.md
• knowledge/usage/best-practice.md
• faq/resource_isolation_faq.md
• administration/management/resource_management/query_queues.md
• administration/management/FE_configuration.mdMohan
08/21/2026, 11:14 AMRocky
08/21/2026, 11:14 AMpipeline_dop setting itself.
While pipeline_dop=8 (on a 32vCPU machine) limits the parallelism within a single node, it does not control how the workload is distributed across nodes. Here is why this might be happening and how to debug it:
1. Data Cache Affinity (The Most Likely Cause)
In StarRocks (especially in Shared-data/Cloud-native mode), tablets are assigned to nodes using Consistent Hashing to ensure that a specific tablet is always scanned by the same node. This allows the node to build a local cache for that tablet.
* The Conflict: You have 100GB of cache but are scanning 400-500GB. This means the cache is constantly being evicted (LRU).
* The Skew: If the hash ring mapping results in one node being "responsible" for more "hot" tablets or simply a larger volume of data (even if tablet counts look okay), that node will perform significantly more remote fetches from S3/HDFS to satisfy the scan, leading to high network and disk I/O.
* 1.5x Skew: You mentioned a 1.5x tablet skew. In a balanced system, this is actually significant. If Node A has 150 tablets and Node B has 100, Node A is doing 50% more work by default. Combined with "heavy" tablets, this creates a massive hotspot.
2. Shuffle/Join Key Skew
If your query involves a JOIN or GROUP BY on a column with skewed values (e.g., many rows have a NULL or a default value for the join key), StarRocks will shuffle all rows with that key to the same node.
* This would explain the network data spike, as other nodes are sending their data to this one "hot" node to perform the join/aggregate.
3. Fixed pipeline_dop vs. Tablet Count
By setting pipeline_dop=8, you have forced a parallelism that might not align with your tablet distribution.
* If a node has 8 tablets and pipeline_dop=8, it works perfectly.
* If a node has 12 tablets, 4 of those tablets must wait for the first 8 to finish (or be multiplexed), potentially creating a bottleneck on that node that makes it look "busier" for longer periods.
──────────
How to Debug Further
Step 1: Analyze the Query Profile (Crucial)
Run the problematic query with SET is_report_success=true; and get the Profile. Look for:
* ScanNode: Compare BytesRead, RowsRead, and ReadFromRemoteSeconds across different BE/CN nodes. If one node has a high ReadFromRemote, it confirms a cache miss/affinity issue.
* ExchangeNode: Check if one node is receiving a disproportionate number of rows (RowsReturned). This indicates a shuffle skew caused by your data's distribution key.
Step 2: Check Actual Data Size Skew
Tablet count is a "blind" metric. Use this SQL to check the actual data volume per node:
sql
SELECT
be_id,
sum(data_size) / 1024 / 1024 / 1024 AS data_gb,
count(*) AS tablet_count
FROM information_schema.be_tablets
GROUP BY be_id;
If the data_gb is skewed more than the tablet_count, you need to re-evaluate your DISTRIBUTED BY HASH(...) keys.
Step 3: Monitor Data Cache Metrics
Run SHOW BACKENDS\G or SHOW COMPUTE NODES\G and look at the DataCacheMetrics field.
* Check if the hotspot node has a much lower Hit Rate or a much higher Write Rate (populating the cache) than others.
Step 4: Check for Partition/Tablet "Hotness"
You can use SHOW PROC '/statistic/table_stat'; to see if specific tablets are being hit more frequently. If your queries are filtered by time, and one node happens to host the tablets for "today's data," that node will always be the hotspot.
Recommendation:
1. Reduce Tablet Skew: Use ADMIN REBALANCE if possible, or recreate the table with a better high-cardinality DISTRIBUTED BY key to get the skew below 1.1x.Rocky
08/21/2026, 11:14 AMRANDOM Distribution: If the data is simply too large for the cache, consider using DISTRIBUTED BY RANDOM (available in newer versions for Duplicate Key tables) to spread the scan load more evenly across nodes at the cost of cache hit rate.
References
• using_starrocks/caching/block_cache.md
• data_source/data_cache_troubleshooting.mdMohan
08/21/2026, 11:20 AMRocky
08/21/2026, 11:20 AMstar_cache/meta) can grow excessively or become inefficient.
* Impact: A node with "bloated" cache metadata may respond slower to I/O, but due to affinity, the FE continues to send it the same tablets. This creates a "slow node" that is still doing the most work.
* Action: Check if your StarRocks version is within these ranges. The fix is to upgrade or manually clear the ${storage_root_path}/starlet_cache/star_cache/meta directory on the CN/BE and restart.
3. Shuffle Skew (Network Data)
You mentioned the node is also receiving more data. This happens during the "Exchange" (Shuffle) phase of a Join or Aggregation.
* Cause: If your query joins on a column where one value is very frequent (e.g., NULL or a common user_id), all nodes will send their rows with that value to the same node to perform the join.
* Verification: Check your Query Profile for ExchangeNode metrics. Look for RowsReturned or BytesReceived. If one node's ExchangeNode is significantly higher than others, you have a Data Skew problem, not a scheduling problem.
4. How to Debug Further (The "Smoking Gun")
To pinpoint why this is happening, you need to look at a Query Profile during the period of high load:
1. Check for "Read Remote" Skew:
In the Profile, look at the OlapScanNode. Compare CompressedBytesReadRemote across nodes. If the "hot" node has 4x more remote reads than others, the FE is definitely sending it more tablet scan tasks.
2. Verify Actual Data Skew (Not just Tablet Count):
Tablet count is misleading. One tablet could be 10MB and another 10GB. Run this to see the real data distribution:
sql
SELECT be_id, sum(data_size) / 1024 / 1024 / 1024 AS data_gb, count(*) AS tablet_count
FROM information_schema.be_tablets
GROUP BY be_id;
3. Check Tablet Scheduling:
If you suspect the FE is biased, check SHOW PROC '/cluster_balance/history_tablets'; to see if the system is constantly trying (and perhaps failing) to move tablets away from that node.
4. Check pipeline_dop Impact:
By fixing pipeline_dop=8, you've removed the system's ability to adapt. If that node is already a bottleneck due to 1.5x more tablets, forcing 8 threads on every query might be causing severe CPU context switching compared to nodes with fewer tablets. Try setting SET GLOBAL pipeline_dop = 0; to allow Adaptive DOP to kick in.
Summary Recommendation:
* Version Check: If you are on an older v3.1/v3.2, clear the cache metadata directory and restart.Rocky
08/21/2026, 11:20 AMADMIN REBALANCE or adjust your DISTRIBUTED BY keys to get the skew under 1.1x.
* Profile: Capture an EXPLAIN ANALYZE of a slow query while the node is "hot" and compare the ScanNode and ExchangeNode across all BE IDs.
References
• sql-reference/System_variable.md
• faq/Sql_faq.md
• knowledge/usage/best-practice.md
• faq/resource_isolation_faq.mdMohan
08/21/2026, 11:25 AMRocky
08/21/2026, 11:25 AMstarlet (cache manager) metadata is re-initialized. If there was a memory-level lock or a corrupted metadata state preventing writes, it is cleared.
3. Cache Warm-up: Upon returning, the node starts fresh. If the underlying issue was transient, it begins writing to the cache disk again, and performance stabilizes until the "stall" condition is met again.
3. How to Debug Further
Since this is hard to reproduce, you need to capture specific evidence the next time it happens:
* Check for I/O Adaptation: StarRocks has a feature that disables caching if the disk I/O is too high. Check if enable_datacache_io_adapter is true (default). If your cache disk is struggling, the node might stop caching to "save" the disk, which ironically makes the CPU and Network load much worse.
* Search for Cache Errors in Logs: Grep the <http://be.INFO|be.INFO> and be.WARNING logs on the hotspot node for:
* star_cache
* write block fail
* disk full or quota exceed
* meta error
* Analyze the Query Profile: Look at the OlapScanNode for a query running on that node. Specifically compare:
* `DataCacheWriteBytes`: Confirm if it is $0$.
* `CompressedBytesReadRemote`: If this is high while DataCacheWriteBytes is $0$, the node is "leaking" performance by fetching but not saving.
* Verify Disk Health: Even if the disk isn't full, a single "slow" or "read-only" sector on the cache disk can cause the cache manager to stop writes while the FE still treats the node as healthy.
4. Immediate Recommendations
1. Set `pipeline_dop = 0`: While not the cause, your fixed pipeline_dop=8 forces 8 threads to hammer the remote storage for every scan on that node. Adaptive DOP would likely scale down the parallelism on a struggling node, reducing the network/CPU spike.
2. Check Cache Percent: Ensure starlet_star_cache_disk_size_percent (default 90) isn't too high. If the OS needs disk space, the cache engine might behave unpredictably. Try lowering it to 80.
3. Audit Version 4.0.8: Since 4.0.x is a major new branch with "unified memory/disk cache," it is possible you've hit a bug in the new cache management logic. If you see fslib star cache meta memory size growing very large in SHOW BACKENDS, it confirms a metadata issue.Rocky
08/21/2026, 11:25 AM<http://be.INFO|be.INFO> logs for cache-related write failures and consider upgrading to the next patch version (e.g., 4.0.9+) if a fix for cache-metadata stalls is listed.
References
• using_starrocks/caching/block_cache.md
• data_source/data_cache.md
• faq/operation_maintenance_faq.md
• faq/Sql_faq.md
• faq/shared_data_faq.mdMohan
08/21/2026, 12:26 PMRocky
08/21/2026, 12:26 PMwrite block cache failed, errmsg: allocate disk block failed and your observations on version 4.0.8, you have identified a classic "Cache Affinity Trap."
Why this causes the Network/Scan hotspot
1. The Allocation Failure: The error means the StarRocks cache engine (starlet) is unable to find or reserve a contiguous block of space on your 100GB cache disk. This happens even if du shows free space, often due to metadata fragmentation, a "stuck" eviction process, or reaching a filesystem-level limit.
2. The Fetch-Discard Loop:
* The node receives a scan request for a tablet it "owns" (via consistent hashing).
* It checks the cache, finds nothing (or a partial miss), and fetches the 400-500GB of data from remote storage (S3/HDFS). This causes the high network/scan volume.
* It tries to write this data to the local cache disk to speed up the next query.
* The write fails with allocate disk block failed. The node discards the data and returns the query result.
3. The Affinity Trap: Because the FE (Front End) assumes this node is the "preferred" host for those specific tablets, it continues to send all queries for that data to the same node. Since the node can never successfully cache the data, it stays in a permanent state of "Remote Fetch -> Fail to Cache -> Discard," while other nodes remain idle.
How to proceed with debugging and resolution
1. Perform a "Hard Reset" of the Cache
A simple restart of the node often only clears the memory-level metadata. If the disk-level metadata is corrupted or the blockfile is "locked," the issue will return within hours.
* Action: Stop the CN/BE node. Manually delete the entire datacache directory (usually under your storage_root_path/starlet_cache/).
* Why: This forces the system to recreate the block files and metadata from scratch, resolving any allocation logic hangs.
2. Reduce the Cache Disk Quota
In version 4.x, the unified cache can be aggressive. If the disk hits 90%+ physical occupancy, the filesystem may refuse block allocations even if StarRocks thinks it has space.
* Action: Lower the starlet_star_cache_disk_size_percent from the default (often 90) to 70 or 80.
* Check: Run SHOW BACKENDS\G and look at DataCacheMetrics. If fslib star cache data disk size is nearly equal to your physical disk capacity, you are cutting it too close.
3. Enable Adaptive Parallelism
Your fixed pipeline_dop=8 is likely making the network/CPU spike worse because it forces 8 threads to hammer the remote storage even when the node is struggling with I/O errors.
* Action: Set SET GLOBAL pipeline_dop = 0;.
* Benefit: This allows StarRocks to automatically scale down the number of threads on a "slow" or struggling node, which can prevent the node from completely saturating your network interface during these failure events.
4. Monitor for "Slow Disk" or IO-Adapter
Check the BE logs for "IO adapter" messages. StarRocks has a mechanism that disables caching if it detects high I/O latency on the cache disk. If your cache disk is a slower HDD or a saturated SSD, it might be triggering a "caching disabled" state which, combined with the allocation error, keeps the node in a high-load loop.
Recommendation: Since this is 4.0.8, if the "Hard Reset" (Step 1) does not permanently fix it, you may be hitting a bug in the new 4.0.x block allocator. I recommend reporting this specific log (allocate disk block failed) to the StarRocks community Slack or GitHub, as it indicates the eviction logic failed to free up blocks before the next allocation attempt.
References
• using_starrocks/caching/block_cache.md
• administration/management/BE_configuration.mdRocky
08/21/2026, 12:26 PMMohan
08/21/2026, 1:21 PMRocky
08/21/2026, 1:21 PMallocate disk block failed usually happens when the cache engine's internal view of "free space" is out of sync with the physical disk or when it cannot evict old data fast enough to make room for new blocks.
* Action: Reduce the cache disk percentage. If you have a 100GB disk, don't let the cache take 90GB.
* Configuration: Add/update this in your CN/BE cn.conf or `be.conf`:
properties
# Reduce from default (90 or 80) to 70 to leave "breathing room" for the filesystem
starlet_star_cache_disk_size_percent = 70
* Why: This ensures that even if there is metadata bloat or log files growing on the same disk, the cache engine won't hit a "hard wall" where it can't even allocate a small metadata block.
2. Enable Adaptive DOP (Crucial)
You mentioned you are using a fixed pipeline_dop = 8. This is dangerous during a failure because it forces every query to use 8 threads of network and CPU even when the node is struggling with I/O errors.
* Action: Set SET GLOBAL pipeline_dop = 0;.
* Why: When pipeline_dop is 0, StarRocks uses Adaptive Parallelism. If a node becomes slow due to cache misses or I/O errors, the system can automatically reduce the number of active threads on that node, preventing it from "melting down" and becoming the cluster bottleneck.
3. Disable "I/O Adaptation" if Disk is Fast
StarRocks sometimes automatically stops caching if it thinks the disk is too slow. In some cases, this detection is too sensitive.
* Configuration: Check if you need to stabilize the cache behavior:
properties
# If your disk is a high-speed SSD/NVMe, you can try setting this to false
# to prevent the node from "giving up" on the cache too easily.
enable_datacache_io_adapter = false
4. Implement Health Monitoring & Alerts
Since the "Affinity Trap" happens silently (queries still pass, they just get very slow), you need to monitor the Data Cache Hit Rate and Write Failures.
* Monitor this metric: starrocks_be_data_cache_write_fail_count (if available in your Prometheus exporter) or watch the <http://be.INFO|be.INFO> logs for allocate disk block failed.
* Dashboard Check: Use SHOW BACKENDS\G periodically. Look at the DataCacheMetrics field. If Status is anything other than Normal, or if DiskUsage is stuck at the limit while HitRate is 0%, the node is in a trap.
5. Automated "Cache Cleanup" Script
If you are on version 4.0.8 and this happens frequently, it might be a bug in the 4.x unified block allocator's eviction logic.
* Tactical Fix: Some teams implement a "Health Check" script that monitors the node. If the script detects HitRate < 5% while RemoteRead is high for more than 30 minutes, it automatically triggers a "Cache Reset":
sql
-- This clears the cache for a specific BE without a full restart
UPDATE be_configs SET VALUE="0" WHERE NAME="datacache_disk_size" AND BE_ID=<problem_node_id>;
-- Wait 1 minute, then set it back
UPDATE be_configs SET VALUE="90G" WHERE NAME="datacache_disk_size" AND BE_ID=<problem_node_id>;
Summary of Prevention
1. Lower starlet_star_cache_disk_size_percent to 70-80.
2. Switch to pipeline_dop = 0 to allow the system to protect itself.
3. Ensure the cache disk is dedicated. Do not store StarRocks logs or meta on the same physical partition as the datacache. If logs grow and fill the disk, the cache allocator will crash.
References
• administration/management/BE_configuration.md
• using_starrocks/caching/block_cache.mdRocky
08/21/2026, 1:21 PMMohan
08/21/2026, 7:36 PMRocky
08/21/2026, 7:36 PMallocate disk block failed you are seeing in your logs is a specific failure in the Starlet block allocator. In version 4.0.8, which utilizes the new unified Data Cache, this usually indicates that the cache engine has hit a metadata or fragmentation limit where it can no longer find contiguous space to store new data, even if the disk appears to have free space.
1. Is there a reported bug for this?
Yes, there have been several "cache stall" and "allocator hang" issues identified in the early 4.0.x branch.
* Version 4.0.9+: Contains fixes for "partial manifest cache writes" (#70652) and improvements to the eviction logic that prevent the cache from getting stuck in a non-writable state.
* Unified Cache Logic: Since 4.0 introduced a unified cache for both internal and external tables, the metadata management is more complex. If you are using Iceberg or other external catalogs alongside cloud-native tables, a bug in the manifest cache could potentially "lock" the block allocator for the entire node.
* Recommendation: Upgrade to at least 4.0.13 or 4.1.x. The 4.0.8 release is an early iteration of the 4.0 architecture; significant stability fixes for the Data Cache were merged in subsequent patches.
2. Is this a "General Scenario"?
It is a "general failure mode" of the Consistent Hashing architecture used by StarRocks:
* The FE sees the node as "Healthy" (it passes heartbeats).
* The FE assigns "hot" data to that node based on its ID.
* The Node fails to cache the data but still completes the query by fetching from remote storage.
* The Result: The node remains the "owner" of that data, but it never stops fetching it from S3/HDFS, leading to the hotspot you observed.
3. How to Identify and Auto-heal
Currently, StarRocks does not have a fully automatic "self-healing" mechanism that detects a 0% cache write rate and moves tablet affinity away. However, you can implement the following:
Identification (Observability)
Monitor the DataCacheMetrics field in SHOW BACKENDS\G.
* Look for: Status: Normal vs other states.
* Monitor Metrics: Use Prometheus to track starrocks_be_data_cache_write_fail_count. If this counter is increasing while starrocks_be_data_cache_write_bytes is 0, the node is "broken."
Manual/Scripted Healing (Node Blacklisting)
StarRocks 4.0 introduced Node Blacklisting. If you identify a node is in an "Affinity Trap":
1. Blacklist the node: You can temporarily exclude the node from the scheduler without shutting it down. This forces the FE to reassign its hot tablets to other healthy nodes.
sql
-- Example syntax (check your version's specific admin command)
ADMIN SET B_NODE_BLACKLIST = "10.0.x.x";
2. Reset the Cache: While the node is blacklisted (and not receiving new scan requests), perform the cache reset:
sql
UPDATE be_configs SET VALUE="0" WHERE NAME="datacache_disk_size" AND BE_ID=<ID>;
-- Wait for cleanup, then restore the size
UPDATE be_configs SET VALUE="100G" WHERE NAME="datacache_disk_size" AND BE_ID=<ID>;
Proactive Prevention
To minimize the chance of the allocator failing:
* Lower `starlet_star_cache_disk_size_percent`: Set it to 70 or 80. The allocate disk block failed error often happens when the disk is too full for the allocator to find a "gap" for new blocks.
* Separate Disks: Ensure the storage_root_path for the cache is not shared with the OS or StarRocks logs. If the log directory fills up the disk, the cache allocator will fail immediately.
Summary: You are likely hitting a bug in the block allocator's eviction/allocation cycle in 4.0.8. Upgrading to a later patch (4.0.13+) is the most direct fix. For now, use the UPDATE be_configs trick to "soft-reset" the cache without a full pod restart.
References
• using_starrocks/caching/block_cache.mdRocky
08/21/2026, 7:36 PMMohan
08/23/2026, 4:53 PMRocky
08/23/2026, 4:54 PMallocate disk block failed error.
1. The "Saturation" Problem
Your metrics show DiskUsage: 229.9GB / 230GB. This means your cache is 100.0% full.
When the cache reaches its configured limit, every new write requires an immediate eviction of an old block. If the system cannot evict and clear a contiguous block fast enough to satisfy the incoming write request, it throws the allocate disk block failed error. Setting your quota to 98% is essentially suffocating the cache engine.
2. Why 230GB instead of 300GB?
There are two reasons why StarRocks sees only 230GB of your 300GB PVC:
* Filesystem Reservation: Linux filesystems (like ext4) typically reserve 5% of space for the root user, which StarRocks cannot use.
* The "Greater Value" Logic: In StarRocks 4.0 (Shared-data), the cache size is determined by the greater of datacache_disk_size and starlet_star_cache_disk_size_percent.
* The default for starlet_star_cache_disk_size_percent is 80%.
* 80% of a 300GB PVC is 240GB. After subtracting filesystem overhead and existing log/metadata files on that same disk, 230GB is exactly what's left.
* Path Sharing: If your storage_root_path (where BE/CN stores logs and metadata) is on the same PVC as your cache, StarRocks will reduce the cache limit to ensure the node doesn't crash if logs grow.
3. What you are missing (Recommended Configs)
To fix the errors and ensure the cache behaves correctly, apply these changes to your be.conf (or cn.conf):
A. Lower the percentage to allow "breathing room"
Do not use 98%. The cache allocator needs a "gap" to work efficiently.
properties
# Change from 98% to 80% or 70%
datacache_disk_size = 80%
# Or set an absolute value to be sure (240GB out of 300GB)
# datacache_disk_size = 257698037760
B. Set the Safety/Safe Level
This tells StarRocks to start background eviction before the disk is totally full.
properties
# When disk usage hits this, StarRocks starts aggressive eviction
disk_safe_level = 75
C. Sync the Starlet parameter
Ensure the Starlet engine (which handles the block allocation) isn't using a different limit.
properties
starlet_star_cache_disk_size_percent = 80
4. How to recover now
Since your cache is currently stuck at 229.9/230, it may not be able to "evict" its way out of the current fragmentation.
1. Clear the stuck state:
sql
-- Replace <BE_ID> with your actual BE ID
UPDATE be_configs SET VALUE="0" WHERE NAME="datacache_disk_size" AND BE_ID=<BE_ID>;
-- Wait 30 seconds
UPDATE be_configs SET VALUE="80%" WHERE NAME="datacache_disk_size" AND BE_ID=<BE_ID>;
2. Verify: Run SHOW BACKENDS\G and check if DiskUsage starts growing from 0 and if the allocate disk block errors stop in the logs.
Pro-tip: If you are using a 300GB PVC, ensure it is mounted specifically for the cache directory (e.g., /opt/starrocks/be/storage/starlet_cache). If it's mounted at the root and shared with /opt/starrocks/be/log, a large log file will cause the cache allocator to fail.
References
• administration/management/BE_configuration.md
• using_starrocks/caching/block_cache.md
• deployment/shared_data/feature-support-shared-data.mdMohan
08/23/2026, 5:02 PMRocky
08/23/2026, 5:02 PMenable_datacache_io_adaptor).
* How it works: It monitors the latency of your local cache disk. If it detects that disk I/O is so high that local reads are becoming slower than remote S3 reads, it will automatically bypass the cache for that query.
* The Problem: In version 4.0.8, the I/O Adaptor can sometimes be "too late." By the time it realizes the disk is saturated, the node's task queue is already backed up, leading to the timeouts you saw.
4. How your 3-month partition.duration fixed it
By limiting the cache to 3 months of data, you essentially ensured that the "hot data" fits (or nearly fits) within the 230GB of disk cache you now have.
* Instead of Thrashing (Read -> Evict -> Write -> Repeat), the system is now in a Stable Hit state (Read -> Hit).
* Because the blocks are already there, the disk Write IOPS drops to near zero. All the disk bandwidth is now available for Read IOPS, which is much faster and more stable.
Summary of what happened:
* Does it ignore large scans? No, it tries to cache everything block-by-block.
* Why did it fail? The 200GB scan forced the 100GB cache into a "Write-Heavy" state. The disk couldn't handle the simultaneous writing of new blocks and reading for the query.
* The "Autoheal": If you want the system to "ignore" caching when the disk is stressed, ensure enable_datacache_io_adaptor = true (default).
Pro-tip: If you expect frequent scans larger than your cache, you can set SET SESSION enable_scan_datacache = false; for those specific large "report" queries. This tells StarRocks: "Read this from S3 directly and don't mess up my local cache for everyone else."
References
• data_source/data_cache.md
• data_source/data_cache_troubleshooting.md
• using_starrocks/caching/block_cache.mdMohan
08/23/2026, 5:06 PMRocky
08/23/2026, 5:06 PMallocate disk block failed error followed by a total cessation of write activity, it is not a "scenario" but a known stability bug in the early 4.0.x unified cache. Here is the technical breakdown of why it happened:
1. The "Allocator Deadlock" (Why writes stopped)
In version 4.0.8, the Block Allocator and the Eviction Manager share a synchronization lock.
* The Trigger: When your cache hit ~98% (229.9GB/230GB), the allocator requested a new block.
* The Failure: Because the disk was so fragmented, the allocator failed to find a contiguous block (allocate disk block failed).
* The Stall: In this version, certain allocation failures could leave the cache engine in a "Dirty" or "Stalled" state. Instead of retrying or clearing space, the internal state machine stops accepting new Write tasks to prevent metadata corruption.
* The Result: Prometheus shows 0 bytes written because the BE has internally disabled the "Cache Population" path for that node, while the "Read" path stays active (fetching from S3 but failing to save it locally).
2. Why it lasted for hours
The Starlet cache engine in 4.0.8 did not have a "self-reset" or "health-check" that could force-clear the allocator state if it stopped writing.
* The FE (Frontend) only checks if the node is "Alive" via heartbeats. It doesn't know the cache engine has crashed internally.
_ The node continues to receive query tasks because the FE thinks, _"This node owns Tablet X, and Tablet X should be in its cache."*
* The node fetches the data from S3, tries to write it to cache, gets rejected by the stalled allocator, and moves on. This loop repeats for hours until a Restart clears the in-memory state of the Starlet library.
3. Why the node became "Slow"
You noticed the node became slow even before it stopped writing. This is caused by CPU and Mutex Contention:
* When the cache is 99% full, the "Eviction" logic has to run for every single 1MB block being read from S3.
* Searching for which block to delete (LRU) and updating the metadata (Manifest) consumes significant CPU and disk I/O.
* This creates a "bottleneck" in the execution thread. Your query isn't slow because of the data transfer; it's slow because the thread is waiting for the Cache Lock to decide where to put the data.
4. Is this fixed?
Yes. There are two major fixes in later 4.0.x and 4.1.x versions:
* Asynchronous Eviction Improvements (#70586): Decouples the "Write" request from the "Eviction" logic, preventing the query from slowing down if the cache is full.
* Manifest Corruption/Stall Fixes (#71459): Prevents the allocator from entering a permanent "stalled" state after a disk allocation failure.
Summary: What you should do
1. Immediate Fix: Keep your datacache_disk_size at 80% (or lower). This ensures the allocator always has "empty pockets" of space and doesn't trigger the lock-up.
2. Long-term Fix: Upgrade to 4.0.13+ or 4.1.x. The 4.0.8 release is notoriously "brittle" when it comes to the new unified cache architecture.
3. Monitoring: Monitor starrocks_be_data_cache_write_bytes. If it stays at 0 for more than 15 minutes during active queries, use the UPDATE be_configs command mentioned earlier to force-reset the cache size to 0 and back to 80%—this often clears the stall without a node restart.
References
• data_source/data_cache_troubleshooting.md
• using_starrocks/caching/block_cache.md