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

Clear checkpoint LSN and backup metadata on import

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT10.0.1, 4.4.7, 5.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • 3
    • Storage - Ra 2021-05-03

      In btree/bt_import.c, we explicitly scrub the values in the metadata fields checkpoint_backup_info and checkpoint_lsn in the import repair case:

      /* Strip out any incremental backup information, an imported file has not  
       * been part of a backup. Strip out the checkpoint LSN, an imported file
       * isn't associated with any log files. Assign a unique file ID.
       */
      cfg[1] = a->data;
      cfg[2] = checkpoint_list;
      cfg[3] = "checkpoint_backup_info=";
      cfg[4] = "checkpoint_lsn="; 

      We do not clear the values in a regular import, which is done in schema/schema_create.

      This ticket is to update the import code in the file_create method of schema/schema_create to clear these metadata values prior to inserting the import metadata. The code change should be made in the block below:

      if (!import_repair) {
          WT_ERR(__wt_scr_alloc(session, 0, &val));
          WT_ERR(__wt_buf_fmt(session, val, "id=%" PRIu32 ",version=(major=%d,minor=%d)",
            ++S2C(session)->next_file_id, WT_BTREE_MAJOR_VERSION_MAX,
            WT_BTREE_MINOR_VERSION_MAX));
          for (p = filecfg; *p != NULL; ++p)
              ;
          *p = val->data;
          WT_ERR(__wt_config_collapse(session, filecfg, &fileconf));
      } 

            Assignee:
            jie.chen@mongodb.com Jie Chen
            Reporter:
            tammy.bailey@mongodb.com Tammy Bailey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: