Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-9708

WT_REF::flags should never change from WT_REF_FLAG_INTERNAL to WT_REF_FLAG_LEAF or vice versa

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: 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)

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            jeremy.thorp@mongodb.com Jeremy Thorp
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: