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

Page deleted structure should be filled before it is published

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None

          /* Allocate and initialize the page-deleted structure. */
          WT_ERR(__wt_calloc_one(session, &ref->page_del));
          ref->page_del->previous_ref_state = previous_state;
      
          /* History store truncation is non-transactional. */
          if (!WT_IS_HS(session->dhandle))
              WT_ERR(__wt_txn_modify_page_delete(session, ref));
      

      Here's the code we currently add a page deleted structure to the page ref. This is wrong as we should fill the content in the page deleted structure first before we publish it to the page ref. Otherwise, the reader may see an unfilled page structure.

      We should also use a WT_PUBLISH to set the page_deleted structure back to NULL instead of directly using a free.

      __wt_free(session, ref->page_del);
      

      In addition, the declaration of the page_deleted structure pointer should be volatile in the current WiredTiger memory model.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            chenhao.qu@mongodb.com Chenhao Qu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: