v.25.8Improvement

Add a server

Added a server setting, logs_to_keep to database replicated settings, that allows changing the default logs_to_keep parameter for replicated databases. Lower values reduce the number of ZNodes (especially if there are many databases), while higher values allow a missing replica to catch up after a longer period of time. #84183 (Alexey Khatskevich).
Added a new server setting logs_to_keep for replicated databases that allows changing the default number of logs retained in ZooKeeper.

Why it matters

This feature addresses the need to control the number of replicated logs stored in ZooKeeper. Reducing logs_to_keep lowers the number of ZNodes, improving ZooKeeper efficiency when many databases exist. Increasing it allows replicas that have been offline longer to catch up without data loss.

How to use it

Users can configure the logs_to_keep parameter in the replicated database settings to adjust how many logs are retained. Setting a lower value reduces ZooKeeper storage, while a higher value increases the catch-up window for replicas.