Issue Description
The RocksDB data store opens the database without setting any info log option, so RocksDB’s defaults apply: max_log_file_size=0 (the current LOG has no size limit), keep_log_file_num=1000 (an old LOG.old. is kept for each restart, up to 1000 files) and stats_dump_period_sec=600 (statistics are written every 10 minutes). The data directory’s info log therefore grows without a total size limit.
These options cannot be set by an administrator: the RocksDbStore settings expose only path, cacheSize, bufferSize, blobSize and poolWorkers, and the database is opened from Options::default() rather than from an OPTIONS file.
Code (v0.16.24):
- crates/store/src/backend/rocksdb/main.rs L109-117: the database options are built from Options::default(), and no info log option is set.
The OPTIONS file RocksDB writes at open shows keep_log_file_num=1000, max_log_file_size=0 and stats_dump_period_sec=600.
Expected Behavior
The RocksDB info log stays within a bounded total size.
Actual Behavior
The current LOG grows until the next restart, each restart adds a LOG.old. file, and up to 1000 such files are kept, so the total size has no limit.
Reproduction Steps
- Run Stalwart v0.16.24 with the RocksDB data store.
- Read the OPTIONS-* file in the data directory: keep_log_file_num=1000, max_log_file_size=0, stats_dump_period_sec=600.
- Restart Stalwart a few times: each restart leaves a new LOG.old., none is removed, and LOG keeps growing between restarts.
Stalwart Version
v0.16.x
Installation Method
Binary (Linux)
Database Backend
RocksDB
Blob Storage
RocksDB
Search Engine
Internal
Directory Backend
Internal
Additional Context
rust-rocksdb already exposes set_max_log_file_size and set_keep_log_file_num, and both are needed to bound the total size of the info log. One option could be to enable this size-based rotation with a finite number of retained files by default, so the bound needs no configuration.
I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.
on
I have searched this support forum (open and closed topics) and confirm this is not a duplicate.
on
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
on