Sangwon
04/23/2026, 8:58 AMRocky
04/23/2026, 8:59 AMADMIN SHOW REPLICA STATUS FROM table_name; and check for Inconsistent status or version mismatches.
2. Primary Key Index (PKI) Recovery & "Error" State
If you are using Primary Key tables, visibility depends on the Primary Key Index.
* The Scenario: After a BE restart, the BE must load the Primary Key Index into memory (or from the persistent index on disk). If the index loading fails or the tablet is marked as "in error state" during recovery, it cannot serve the latest data.
* The Visibility Gap: A tablet in an "Error" state may temporarily return empty results or fall back to an older version until the index is successfully rebuilt or the tablet is repaired.
* Why it resolves: The system automatically attempts to repair error-state tablets or rebuild indexes in the background.
3. Publish Version Latency
* The Scenario: StarRocks uses a two-phase commit. A transaction moves to VISIBLE on the FE after the data is written, but the FE must then "Publish" the version to all BEs.
* The Visibility Gap: If enable_sync_publish is disabled or there is high network/RPC congestion, there is a small window where the FE marks the transaction as successful, but some BEs haven't yet updated their local metadata to point to the new Rowset.
* Why it resolves: The publish task eventually succeeds, and all BEs acknowledge the new version.
4. Shared-data Architecture: Metadata Sync & Vacuuming
In shared-data (Cloud-native) mode, there are unique scenarios:
* Metadata Stale in Follower FEs: If you have multiple FEs, a Follower FE might have a slightly stale view of the tablet's latest version compared to the Leader FE.
* Vacuuming vs. Long-running Queries: If a query is using an old version that was just vacuumed (deleted) from object storage, it might fail or return inconsistent results.
* Persistent Index Inconsistency: If the persistent index on object storage for a PK table becomes inconsistent during a BE restart or migration, it can lead to "missing" rows until the index is re-synchronized.
5. Known Bug: Version Recognition (v3.2.x specifically)
* The Scenario: There was a known issue (#58404) in some v3.2 releases where a "defect in priority evaluation logic when loading tablets" caused incorrect version recognition after BE restarts. This could lead to temporary data loss where the BE failed to recognize the newest rowsets.
* The Visibility Gap: Data would appear "gone" after a restart and only reappear after the BE correctly re-identified the versions through background metadata checks.
6. Tablet Migration & Load BalancingRocky
04/23/2026, 8:59 AMSHOW TABLET FROM table_name; and look for tablets where IsBad is true or Version is lower than expected.
2. Compare Replica Versions: Use SELECT * FROM information_schema.be_tablets WHERE TABLE_NAME = 'your_table'; to see if different BEs report different versions for the same tablet.
3. Audit FE Logs: Look for publish version errors or tablet manager warnings in fe.warn.log.
4. Query Profile: If a query returns 0 results unexpectedly, grab the Query ID and run get_query_profile('query_id');. Look for ScanRanges to see which BEs were involved and if any reported errors.
If this is happening frequently after BE restarts, it is most likely Scenario 1 or 2. If you are on an older version of 3.2, I strongly recommend checking your specific patch version for the bug mentioned in Scenario 5.
References
• administration/management/BE_configuration.md
• best_practices/primarykey_table.mdSangwon
04/23/2026, 9:08 AMRocky
04/23/2026, 9:09 AMiceberg_table_cache_refresh_interval_sec). After this, it triggers an asynchronous refresh. Once the refresh completes, the latest data "reappears."
* BE Restart Connection: A BE restart doesn't directly cause this, but it may lead to query retries or FE re-planning, which makes you more likely to notice the cache staleness as the system "settles" after the restart.
2. FE Metadata Disk Cache (Persistent "Stale" State)
If you have enabled enable_iceberg_metadata_disk_cache = true in your FE configuration:
* The Scenario: StarRocks saves Iceberg metadata to the FE's local disk.
* The Visibility Gap: Upon an FE restart, StarRocks may load the metadata snapshot from its local disk cache instead of fetching the latest version from S3. If the disk-cached version is significantly older than the live version in S3, you will see stale data or 0 results.
* Why it resolves: The background refresh mechanism (background_refresh_metadata_interval_millis, default 10 mins) eventually identifies the version mismatch and updates the metadata.
3. Consistency Between Multiple FEs
If your cluster has multiple FEs (Leader and Followers):
* The Scenario: A query might hit a Follower FE that has a stale metadata cache, while the Leader FE has already refreshed.
* The Visibility Gap: If a BE restart causes the client to reconnect or the load balancer to shift queries to a different FE, you might intermittently hit a "stale" FE that returns 0 results, and then hit a "fresh" FE where the data appears.
* Why it resolves: All FEs eventually sync their metadata with the Metastore through background polling.
4. BE Data Cache (Disk Cache on S3)
The BEs maintain a "Data Cache" (blocks of data from S3 stored on local BE disks).
* Is it possible to read a "stale snapshot" from here?
* For Data: Generally, no. Iceberg is immutable (it writes new files for updates). If the FE gives the BE a list of new files, the BE won't find them in the old cache and will fetch from S3.
* For Footers: BEs cache file footers (Parquet/ORC). If a file was somehow replaced with the exact same name/size/modification time (rare in Iceberg), the BE might read the old footer.
* The "0 Results" link: Data Cache issues usually cause stale data (old rows), not 0 results. If you see 0 results, the problem is almost always at the FE Metadata level, where the FE tells the BE "there are no files to read."
5. AWS Glue / Metastore Sync Latency
If you use AWS Glue as your Iceberg Metastore:
* The Scenario: Sometimes there is a slight propagation delay in Glue itself.Rocky
04/23/2026, 9:09 AMfe.conf or as session variables:
Parameter | Default | Recommendation for Freshness
enable_iceberg_metadata_cache | true | Set to false to test if the gap disappears (will slow down queries).
iceberg_table_cache_refresh_interval_sec | 60s | Reduce to 5s or 10s for faster metadata updates.
enable_iceberg_metadata_disk_cache | false | Ensure this is false if you want to avoid stale metadata after FE restarts.
background_refresh_metadata_interval_millis | 600000 (10m) | Reduce to 60000 (1m) for more frequent background polling.
Pro-Tip: If you see 0 results again, immediately run REFRESH EXTERNAL TABLE table_name;. If the data appears instantly after this command, you have confirmed that the issue is the FE Metadata Cache.
References
• data_source/datalake_faq.md
• data_source/catalog/iceberg/iceberg_catalog.md
• data_source/feature-support-data-lake-analytics.md
• quick_start/iceberg.md
• data_source/External_table.mdSangwon
04/23/2026, 9:13 AMRocky
04/23/2026, 9:13 AMfilename + modification_time. Since Iceberg data files are immutable, a "stale" file shouldn't technically exist—you either read the correct file or the file is gone. However, if the FE metadata is stale, it will tell the CN to read an old file list, and the CN will happily serve those files from its local disk cache if they are still there.
2. Distributed Metadata Planning
For Iceberg specifically, StarRocks often uses a Distributed Plan for large tables.
* The Scenario: The FE assigns the task of parsing Iceberg manifest files (which list the actual data files) to the BE/CN nodes.
* The Visibility Gap: If a CN is struggling or has just restarted, there might be a slight delay in it becoming "ready" to participate in this distributed metadata parsing.
* Impact: If the FE tries to distribute a metadata scan to a CN that is still initializing its cache or network stack, the query might fail or return incomplete results until the CN is fully healthy.
3. Consistency Across Nodes
If you have a mix of BEs and CNs (or multiple CNs):
* A query might be scheduled to CN-A for one execution and CN-B (or a BE) for the next.
* If CN-A has a certain set of data blocks cached and CN-B does not, you might see a performance difference, but you shouldn't see a "visibility" difference unless the FE itself is providing different plans to different nodes (which brings us back to the FE Metadata Cache).
4. The "0 Results" Root Cause (Still FE-Driven)
The "0 results" issue you described is almost always an FE-level event.
_ The CN is just an "executor." It asks the FE: _"Which files should I read?"*
_ If the FE says _"There are no files"* (because its Iceberg metadata cache hasn't refreshed yet), the CN returns 0 results.
* Whether you use BEs or CNs for the computation doesn't change the fact that they are both waiting for the FE to "see" the new Iceberg snapshot.
Summary for CN Environment:
If you are running in a Cloud-Native/K8s environment with CNs:
1. Check Ephemeral vs. Persistent Cache: If your CN disks are wiped on every restart, they will always have a "cold start" period where queries to S3 are slower, but this shouldn't cause data to disappear (it just causes higher latency).
2. CN Readiness Probes: Ensure your Kubernetes readiness probes are correctly configured. If a CN is marked "Ready" by K8s but hasn't fully joined the StarRocks cluster metadata, the FE might send it queries that result in errors or empty sets.
3. Metadata Freshness: Focus on the FE settings I mentioned previously (iceberg_table_cache_refresh_interval_sec). This is the "brain" that controls what the CNs "see."
In short: Switching from BE to CN (or vice versa) will not solve the visibility gap, as the root cause lives in the FE's metadata management logic.
References
• data_source/catalog/maxcompute_catalog.md
• data_source/catalog/hive_catalog.md
• administration/management/FE_configuration.mdRocky
04/23/2026, 9:13 AM