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

Random cursor on empty tiered table loops forever

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • WT10.0.1, 4.4.7, 5.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      The random cursor implementation for tiered cursors is quite simple.  It picks a tier at random and picks a random element from it.  If that tier is empty it tries again.  The problem (as the code below shows) is that if all the tiers are empty it will never stop trying.

          for (;;) {
              __curtiered_random_tier(session, curtiered, &c);
              /*
               * This call to next_random on the tier can potentially end in WT_NOTFOUND if the tier we
               * picked is empty. We want to retry in that case.
               */
              WT_ERR_NOTFOUND_OK(__wt_curfile_next_random(c), true);
              if (ret == WT_NOTFOUND)
                  continue;
      

            Assignee:
            keith.smith@mongodb.com Keith Smith
            Reporter:
            keith.smith@mongodb.com Keith Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: