- 
    Type:
Bug
 - 
    Resolution: Duplicate
 - 
    Priority:
Major - P3
 - 
    None
 - 
    Affects Version/s: None
 - 
    Component/s: None
 
- 
        Storage - Ra 2020-09-07
 - 
        None
 
As part of WT-6374, a change was made to create the history store prior to replaying log files as the log files could trigger a write into the history store or something similar. That change relied on the assumption that recovery_file_scan will update the global file id counter, however that is actually done in a separate code line in wt_txn_recover as such when the history store is created in wt_txn_recover it is created with file id 1. 
This doesn't seem to be an issue when upgrading from any version that created a lookaside file (as the very first file) as the history store gets inserted at id 1 where the lookaside file was. However it appears that if we upgraded from an older version e.g. 3.2 file id 1 is in use. See: WT-6623. 
There's at least one to fix here and potentially a second:
1. Update the global file id prior to creation of the history store.
2. Potentially create a way to handle this situation arising for a user again, with some sort of utility to fix the metadata file?