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

Do not allow the use of reserved names for checkpoint cursors

    • 3
    • 2023-03-21 Ellen Ripley

      When one opens a checkpoint cursor, they can either indicate the name of the checkpoint or leave the name blank so it tries to open on the latest internal WiredTiger checkpoint.

      An internal WiredTiger checkpoint has the specific name "WiredTigerCheckpoint" but a suffix made of a dot and a number is appended every time there is a new internal checkpoint, i.e "WiredTigerCheckpoint.6".

      What if one tries to open a checkpoint cursor and gives the name "WiredTigerCheckpoint.x", how do we want to process this request?
      The current checkpoint cursor code seems to treat it as an unnamed checkpoint but does not see it as an internal checkpoint name either:

              /*
               * Test for the internal checkpoint name (WiredTigerCheckpoint). Note: must_resolve is true
               * in a subset of the cases where is_unnamed_ckpt is true.
               */
              must_resolve = WT_STRING_MATCH(WT_CHECKPOINT, checkpoint_name, strlen(checkpoint_name));
              is_unnamed_ckpt = strlen(checkpoint_name) >= strlen(WT_CHECKPOINT) &&
                WT_PREFIX_MATCH(checkpoint_name, WT_CHECKPOINT);
      

      must_resolve is 0 and is_unnamed_ckpt is 1.

      The solution to this issue would be to not allow the use of reserved names when dealing with checkpoints cursors by returning EINVAL.

            Assignee:
            etienne.petrel@mongodb.com Etienne Petrel
            Reporter:
            etienne.petrel@mongodb.com Etienne Petrel
            Clarisse Cheah
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: