- 
    Type:
Improvement
 - 
    Resolution: Unresolved
 - 
    Priority:
Major - P3
 - 
    None
 - 
    Affects Version/s: None
 - 
    Component/s: None
 
- 
        None
 - 
        None
 
Summary
WT_REF::flags should never change from WT_REF_FLAG_INTERNAL to WT_REF_FLAG_LEAF or vice versa
Motivation
Currently, in __wt_btree_new_leaf_page(), the flags in a WT_REF can change from 
WT_REF_FLAG_INTERNAL to WT_REF_FLAG_LEAF being set.
During the investigation for WT-9057, alexander.gorrod@mongodb.com and I determined that the code would be safer from the risk of race conditions if WT_REF::flags never change from WT_REF_FLAG_INTERNAL to WT_REF_FLAG_LEAF or vice versa. However, the code changes required to do this are not straightforward.
- Does this affect any team outside of WT?
No 
- How likely is it that this use case or problem will occur?
Unlikely 
- If the problem does occur, what are the consequences and how severe are they?
It might cause a crash. 
- Is this issue urgent?
No 
Acceptance Criteria (Definition of Done)
A code inspection shows that the WT_REF::flags can never change from WT_REF_FLAG_INTERNAL to WT_REF_FLAG_LEAF or vice versa, and asserts are in place to enforce the correct flag state where required.
- Testing
Existing tests pass 
- Documentation update
N/A 
There has been a lot of useful discussion in WT-9057 that is relevant for this ticket too.
using related to, depends on, dependent on by links)
- is related to
 - 
                    
WT-9057 Null address read in compact walk
-         
 - Closed
 
 -