<@U0A71G31CDV> when I moved sys_log_delete_age fro...
# questions-and-troubleshooting
z
@Rocky when I moved sys_log_delete_age from 7d to 3d after pod restarts does not it delete older logs?
r
When you change
sys_log_delete_age
in StarRocks, whether it takes effect immediately depends on which component (FE or BE) you are configuring and how the logging system triggers the cleanup. 1. FE (Frontend) Behavior
sys_log_delete_age
is a configuration parameter for the FE. * Trigger on Rollover: The FE uses Log4j for logging. Log4j's deletion policy (which
sys_log_delete_age
configures) is typically triggered during a log rollover event, not immediately upon startup. * Rollover Conditions: Rollover happens when the current log file reaches a certain size (defined by
sys_log_roll_mode
, default 1GB) or a certain time interval (defined by
sys_log_roll_interval
, default
DAY
). * Solution: If you just restarted the pod and the current log file hasn't rolled over yet (e.g., it hasn't reached 1GB or the next day hasn't started), the old logs may still be sitting there. They should be cleaned up once the first rollover occurs under the new configuration. 2. BE (Backend) Behavior If you are looking at BE logs, the parameter
sys_log_delete_age
does not exist for the Backend. * Retention by Number: BE logs are managed by
sys_log_roll_num
(default 10). It keeps a specific number of old log files regardless of how many days old they are. * Configuration: If you want to limit disk usage on the BE, you should adjust
sys_log_roll_num
or the size/time limits in
sys_log_roll_mode
. Setting
sys_log_delete_age
in
be.conf
will have no effect. 3. Kubernetes / Pod Specifics * Static vs. Dynamic:
sys_log_delete_age
is a static parameter for the FE. Since you restarted the pod, the new value should be active (you can verify this by running
ADMIN SHOW FRONTEND CONFIG LIKE 'sys_log_delete_age';
). * Persistent Volumes: If your logs are stored on a Persistent Volume (PV), they will persist across restarts. If they are not being deleted, it is likely due to the "Trigger on Rollover" behavior mentioned above. * Stdout Logging: If you have
sys_log_to_console = true
(common in Kubernetes setups to let
kubectl logs
handle them), StarRocks might not be managing local file deletion the same way, as logs are often being streamed to the container's stdout instead of being rotated locally. Summary Recommendation: * Check if you are looking at FE or BE logs. * If FE, wait for a log rollover (or temporarily reduce
sys_log_roll_mode
to a small size like
SIZE-MB-1
to force a rollover and test if deletion triggers). * If BE, use
sys_log_roll_num
instead. Referencesadministration/management/FE_configuration.mdadministration/management/BE_configuration.md