There are two passes in recovery. The first pass recovers the metadata, and then the second pass recovers the data in all the tables.
The first pass sends in flags of 0 to wt_log_scan. There are some different code paths in wt_log_scan based on WT_LOGSCAN_RECOVER. In particular, many error paths give helpful messages during recovery where valid LSNs are expected. If there's an invalid LSN during the metadata recovery phase those helpful messages are not printed out and they should be.
Possible solutions are:
- Have the metadata-only call to wt_log_scan send in the WT_LOGSCAN_RECOVER flag. This is a simple change, but care must be taken to make sure there are no other undesired side effects of that flag during this phase of recovery.
- If there are side effects, perhaps add another flag like WT_LOGSCAN_RECOVER_METADATA that avoids the side effects but still prints out helpful messages.