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

Make drop table close dhandles

    • Storage Engines
    • 2
    • 2023-05-30 - 7.0 Readiness, StorEng - 2023-06-13, 2023-06-27 Lord of the Sprints

      In her work on BF-28485, monica.ng@mongodb.com identified that WT-10994 was a necessary, but not sufficient, fix for BF-28485. Specifically, her testing showed that the following change was required (in addition to the changes in WT-10994).

      diff --git a/src/third_party/wiredtiger/src/schema/schema_drop.c b/src/third_party/wiredtiger/src/schema/schema_drop.c
      index 354e779b908..d425d191395 100644
      --- a/src/third_party/wiredtiger/src/schema/schema_drop.c
      +++ b/src/third_party/wiredtiger/src/schema/schema_drop.c
      @@ -92,7 +92,7 @@ __drop_index(WT_SESSION_IMPL *session, const char *uri, bool force, const char *
        *     WT_SESSION::drop for a table.
        */
       static int
      -__drop_table(WT_SESSION_IMPL *session, const char *uri, const char *cfg[])
      +__drop_table(WT_SESSION_IMPL *session, const char *uri, bool force, const char *cfg[])
       {
           WT_COLGROUP *colgroup;
           WT_DECL_RET;
      @@ -110,6 +110,9 @@ __drop_table(WT_SESSION_IMPL *session, const char *uri, const char *cfg[])
           table = NULL;
           tracked = false;
       
      +    WT_WITH_HANDLE_LIST_WRITE_LOCK(
      +      session, ret = __wt_conn_dhandle_close_all(session, uri, true, force));
      +
           /*
            * Open the table so we can drop its column groups and indexes.
            *
      @@ -336,7 +339,7 @@ __schema_drop(WT_SESSION_IMPL *session, const char *uri, const char *cfg[])
           else if (WT_PREFIX_MATCH(uri, "lsm:"))
               ret = __wt_lsm_tree_drop(session, uri, cfg);
           else if (WT_PREFIX_MATCH(uri, "table:"))
      -        ret = __drop_table(session, uri, cfg);
      +        ret = __drop_table(session, uri, force, cfg);
           else if (WT_PREFIX_MATCH(uri, "tiered:"))
               ret = __drop_tiered(session, uri, force, cfg);
           else if ((dsrc = __wt_schema_get_source(session, uri)) != NULL) 

      This ticket will make and test that change.

            Assignee:
            jeremy.thorp@mongodb.com Jeremy Thorp
            Reporter:
            jeremy.thorp@mongodb.com Jeremy Thorp
            Monica Ng
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: