I noticed that there are a lot of LOG.old files.What I did:
-shutdown stalwart
modify the OPTIONS file of the RocksDB with the greatest number (OPTIONS-1007) in which I decresed the number from 1000 to 10
start stalwart
I was expecting RocksDB to take into consideration the new option.
Unfortunately a new OPTIONS file was created and the option keep_log_file_num was back at 1000.
How can I change this option in order to be persistent after stalwart reload and upgrade?
I reaserch the forum but the solution people used is to delete them by a script not changing the RocksDB behaviour.
Thanks,
Andrei
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.
This confirms there’s no exposed configuration option for keep_log_file_num. The source shows the setting is hard-coded (and actually commented out, so it stays at RocksDB’s own default of 1000, which explains why the OPTIONS file kept reverting).
I can give a grounded answer now: there is no config setting for this in Stalwart, it’s not exposed via the DataStore object, and manually editing the OPTIONS file won’t stick because Stalwart writes its own options on startup (only path, blobSize, bufferSize, poolWorkers are configurable).
keep_log_file_num is not a configurable option in Stalwart. Stalwart opens RocksDB with its own hard-coded Options set at startup (in crates/store/src/backend/rocksdb/main.rs), and that call always creates/overwrites the OPTIONS file for the database, so manual edits to the OPTIONS file are discarded on every restart. In the current code the set_keep_log_file_num() call is actually commented out, meaning RocksDB falls back to its own default (1000), which is why you keep seeing the option reset regardless of what you write into the file.
The only configurable RocksDB fields exposed through the DataStore object are path, blobSize, bufferSize, and poolWorkers (see RocksDB storage docs). There is currently no setting to control log retention, so periodically cleaning up LOG.old.* files with an external script remains the only way to manage this until such an option is exposed in configuration.
This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.