__wt_clsm_open calls __clsm_close

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • WT2.5.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • None

      @agorrod, I had a question about __wt_clsm_open I didn't want to lose, so I'm creating an issue.

      Obviously, not urgent.

      In __wt_clsm_open, there's this code:

              /* 
               * The tree's dsk_gen starts at one, so starting the cursor on zero
               * will force a call into open_cursors on the first operation.
               */
              clsm->dsk_gen = 0;
               
              WT_STATIC_ASSERT(offsetof(WT_CURSOR_LSM, iface) == 0);
              WT_ERR(__wt_cursor_init(cursor, cursor->uri, owner, cfg, cursorp));
              
              if (0) {
      err:            __wt_lsm_tree_release(session, lsm_tree);
                      if (clsm != NULL) {
                              clsm->lsm_tree = NULL;
                              WT_TRET(__clsm_close(cursor));
                      }
              }
      

      This is probably wrong, I think we should be able to call free(clsm) instead of *clsm_close; if I'm wrong, we shouldn't call *wt_lsm_tree_release, as _clsm_close does that, and in this case I think the current code would result in _wt_lsm_tree_release being called twice.

            Assignee:
            Alexander Gorrod
            Reporter:
            Keith Bostic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: