The current log file preallocation algorithm, which is implemented in the __log_server function has a few aspects that should be improved:
- The loop uses a timer - but it only waits around a condition variable - it should instead re-set only when a preallocated log file is created. It's possible with the current implementation that some workloads won't pre-allocate log files.
- I'm concerned that preallocation waits for the hot backup lock - which can be held for a long time if a hot backup is in progress. A try lock might be better in the code - to avoid other operations done by the log server being starved.