When can I remove old txn logs?

Hi,

This is expected, depending on your snapshots_to_keep and snapshot_trigger_size. We keep extra logs on “standby”, but we also keep around logs that have valid content. Log content between snapshots is split into multiple fixed-size logs, so it’s not unusual to have many small log files.

As an example:
Suppose you have snapshot_trigger_size set to 2GB, snapshots_to_keep set to 2, and log_file_size_partitions set to 16MB. In that case, you would keep 2GB worth of log content between each snapshot you keep on disk, or up to 4GB per partition. That means each partition would keep up to 250 log files.

If you manually take snapshots, you can manually control how much space exists between each snapshot, forcing a cleanup of log files, but if you then let the system run, it’ll eventually create a bunch of new log files with log content.

If you want to reduce the total amount of space occupied by all log files, not just unused ones, you also need to adjust snapshots_to_keep and snapshot_trigger_size.