<@U0A71G31CDV> starrocks cn pod with mount point o...
# questions-and-troubleshooting
r
@Rocky starrocks cn pod with mount point opt/starrocks/cn/spill and storage, what data used there and is that ok to delete when delete pod? I want to use this option whenDelete("delete") of pvc for cn pod.
r
For StarRocks CN (Compute Node) pods, the directories
/opt/starrocks/cn/spill
and
/opt/starrocks/cn/storage
are used for temporary and performance-related data. It is generally safe to delete these when a pod is deleted (using
whenDelete("delete")
for the PVC), as CN nodes are designed to be stateless in a shared-data architecture. Here is a breakdown of what data is stored in those locations: 1.
/opt/starrocks/cn/spill
* What is it? This directory is used for the Spill to Disk feature (controlled by
spill_local_storage_dir
). * What data is used there? It stores intermediate results for memory-intensive queries (e.g., large Joins, Sorts, or Aggregations) that exceed the memory limit. * Is it safe to delete? Yes. This data is transient and only relevant to active queries. StarRocks normally attempts to clean this up after a query finishes or when the node restarts. Deleting the PVC will not cause any data loss. 2.
/opt/starrocks/cn/storage
* What is it? This is the directory configured by
storage_root_path
. On a CN node, it is primarily used for the Data Cache (starlet_cache). * What data is used there? * Data Cache: It caches hot data from your remote storage (S3, HDFS, etc.) to speed up queries. * Persistent Index (Shared-Data): If you use Primary Key tables with
CLOUD_NATIVE
persistent indexes, the local disk serves as a cache for those indexes. * Is it safe to delete? Yes. Since the "source of truth" for your data is in remote object storage (like S3 or HDFS), deleting the local cache is safe. Is it OK to use
whenDelete("delete")
?
Yes, it is a common and recommended practice for CN pods in Kubernetes to use
whenDelete("delete")
to save on storage costs, especially if you are auto-scaling your CN cluster. What to expect if you delete the PVC: * Cold Start Performance: When a new CN pod starts up, its cache will be empty. The first few queries may be slower because the node has to fetch data from remote storage instead of the local disk cache. * No Data Loss: You will not lose any table data or metadata, as those are stored in the FE (metadata) and Remote Storage (data). Recommendation If your priority is cost-saving and elasticity, go ahead with
whenDelete("delete")
. If your priority is consistent query performance across pod restarts (e.g., you want to avoid the "cold cache" penalty), you should keep the PVCs by using
whenDelete("retain")
or the default behavior. Referencesfaq/shared_data_faq.mddeployment/shared_data/s3.mdquick_start/shared-data.mddeployment/shared_data/hdfs.mdadministration/management/BE_configuration.mdbest_practices/primarykey_table.mddeployment/shared_data/minio.md