It would be helpful to detect that a binary cannot read the log files before it opens the logging subsystem and this restart creates the new log. We now have the infrastructure in the code to verify the log files from WT-4056.
One problematic scenario motivating this work:
- User running at MongoDB 4.0 (i.e. WT version 3.1) with compatibility required 3.1. Shutdown MongoDB.
- User starts database with a 3.6 binary (i.e. WT version 3.0). WT currently creates a version 3.0 log file before recovery opens and detects the version 3.1 log file is newer and in the future and errors.
- Restarting database on MongoDB 4.0 with compatibilty req 3.1 fails due to the version 3.0 log file that was created.
- End result is that no binary can now start on the database in this situation.
In wt_log_open we call log_open_verify only if we're validating a minimum required compatibility version. Relax that to always call the verify function.