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

Hang after opening a checkpoint cursor

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • 5
    • 2023-04-04 Bibbidi-Bobbidi-Boo

      While working on WT-10545 with clarisse.cheah@mongodb.com, we found another way to make a checkpoint cursor hang:

      diff --git a/test/suite/test_checkpoint12.py b/test/suite/test_checkpoint12.py
      index 71e432bd1..548bed290 100644
      --- a/test/suite/test_checkpoint12.py
      +++ b/test/suite/test_checkpoint12.py
      @@ -107,7 +107,7 @@ class test_checkpoint(wttest.WiredTigerTestCase):
               self.large_updates(uri, ds, nrows, value_a, 20)
       
               # Open the checkpoint.
      -        ckpt_cursor = self.session.open_cursor(uri, None, 'checkpoint=WiredTigerCheckpoint')
      +        ckpt_cursor = self.session.open_cursor(uri, None, 'checkpoint=WiredTigerCheckpoint1')
               ckpt_cursor.set_key(ds.key(1))
       
               # Write some further data, and prepare it at time 30.
      

      Executing the test should lead to a hang.

      Changing the following line generates the expected error:

      diff --git a/src/session/session_dhandle.c b/src/session/session_dhandle.c
      index 3f014755c..d3c8243f2 100644
      --- a/src/session/session_dhandle.c
      +++ b/src/session/session_dhandle.c
      @@ -492,7 +492,7 @@ __wt_session_get_btree_ckpt(WT_SESSION_IMPL *session, const char *uri, const cha
            * subset of the cases where is_unnamed_ckpt is true.
            */
           must_resolve = WT_STRING_MATCH(WT_CHECKPOINT, cval.str, cval.len);
      -    is_unnamed_ckpt = cval.len >= strlen(WT_CHECKPOINT) && WT_PREFIX_MATCH(cval.str, WT_CHECKPOINT);
      +    is_unnamed_ckpt = cval.len == strlen(WT_CHECKPOINT) && WT_PREFIX_MATCH(cval.str, WT_CHECKPOINT);
      

      Error:

      Traceback (most recent call last):
        File "/home/ubuntu/wiredtiger/test/suite/wttest.py", line 426, in _callTestMethod
          method()
        File "/home/ubuntu/wiredtiger/test/suite/test_checkpoint12.py", line 110, in test_checkpoint
          ckpt_cursor = self.session.open_cursor(uri, None, 'checkpoint=WiredTigerCheckpoint1')
      _wiredtiger.WiredTigerError: No such file or directory
      

      This code change is probably wrong if it is allowed to have checkpoints with names that start with WiredTigerCheckpoint.

      This ticket should change the code so it is either not allowed to have a checkpoint with a name that starts with WiredTigerCheckpoint or simply check first if the requested checkpoint exists.

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

              Created:
              Updated:
              Resolved: