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

session.create "exclusive" configuration doesn't work for non-table objects

    • Type: Icon: Task Task
    • Resolution: Done
    • WT1.2
    • Affects Version/s: None
    • Component/s: None

      The session.create "exclusive" configuration works for tables, but not for files.

      Here's the test program:

      
      #include <assert.h>
      #include <stdio.h>
      #include <stdlib.h>
      #include <wiredtiger.h>
      
      void
      die(const char *m, int e)
      {
              fprintf(stderr, "%s: %s\n", m, wiredtiger_strerror(e));
              exit(1);
      }
      
      int
      main(int argc, char *argv[])
      {
              WT_CONNECTION *conn;
              WT_SESSION *session;
              int ret;
      
              system("rm -rf WT_TEST && mkdir WT_TEST");
      
              if ((ret =
                  wiredtiger_open("WT_TEST", NULL, "create", &conn)) != 0)
                      die("wiredtiger_open", ret);
      
              if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
                      die("conn.open_session", ret);
      
              if ((ret = session->create(session, "file:aaa", argv[1])) != 0) 
                      die("session.create WT-1", ret);
              if ((ret = session->create(session, "file:aaa", argv[1])) != 0) 
                      die("session.create WT-2", ret);
              if ((ret = session->create(session, "file:aaa", argv[1])) != 0) 
                      die("session.create WT-3", ret);
              exit (0);
      }
      

      and it runs cleanly regardless of the exclusive flag:

      bengal:thread {130} ./a.out
      bengal:thread {131} ./a.out exclusive
      

      A similar test for colgroups (create a table, then try to repeatedly create the colgroup) gives me:

      bengal:thread {146} ./a.out
      session.create WT-1: WT_DUPLICATE_KEY: attempt to insert an existing key
      bengal:thread {147} ./a.out exclusive
      session.create WT-1: WT_DUPLICATE_KEY: attempt to insert an existing key
      

      which isn't what I expected?

      I didn't try multiple creates of indexes.

            Assignee:
            michael.cahill@mongodb.com Michael Cahill (Inactive)
            Reporter:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: