Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Skill Level:
      Regular Contributors Level (Easy to Medium)

      Description

      Add a uuid to db_header to distinguish different databases that have the same name (for example, by deleting and creating the same named database).

      1. db_uuids_v2.patch
        5 kB
        Randall Leeds
      2. db_uuids.patch
        4 kB
        Randall Leeds
      3. db_uuids.patch
        4 kB
        Randall Leeds
      4. 0001-add-uuid-to-database-on-creation-return-it-in-db_in.patch
        2 kB
        Robert Newson

        Issue Links

          Activity

          Hide
          rnewson Robert Newson added a comment -

          Yup.

          Sent from my iPhone

          Show
          rnewson Robert Newson added a comment - Yup. Sent from my iPhone
          Hide
          kxepal Alexander Shorin added a comment -

          CouchDB 2.0 provides UUID for databases on backdoor interface. Should this be counted as a fix? cc Robert Newson

          Show
          kxepal Alexander Shorin added a comment - CouchDB 2.0 provides UUID for databases on backdoor interface. Should this be counted as a fix? cc Robert Newson
          Hide
          tilgovi Randall Leeds added a comment -

          Blocked until we sort out the discussion in COUCHDB-782

          Show
          tilgovi Randall Leeds added a comment - Blocked until we sort out the discussion in COUCHDB-782
          Hide
          tilgovi Randall Leeds added a comment -

          Here's a new patch.

          I had to change test/etap/160-vhosts.t test to not depend on the length of the db info record return by a call to /db. I think this is fine since that's not what the vhost etap is intended to test.

          I cleaned up naughty white space issues with the futon tests.

          I updated the compaction code to copy the uuid over when swapping the files.

          To be sure this all works I ran a test on my own machine where I copied a 0.10.0 database to my dev couch. Opening it returns a new uuid. Restarting the couch will regenerate a new uuid until a write of any kind causes the db header to be written (including a compaction) at which point the uuid persists and tracks the instance.

          I also copied an old database, opened it, made an update, and then copied the same old database again and added .compact to the name. This acts like a partially completely compaction. The old .compact file is opened without a hitch and the uuid persists after compaction completes.

          Looks all good to me, now. Thanks rnewson for realizing that the interaction with compaction should be checked.

          Show
          tilgovi Randall Leeds added a comment - Here's a new patch. I had to change test/etap/160-vhosts.t test to not depend on the length of the db info record return by a call to /db. I think this is fine since that's not what the vhost etap is intended to test. I cleaned up naughty white space issues with the futon tests. I updated the compaction code to copy the uuid over when swapping the files. To be sure this all works I ran a test on my own machine where I copied a 0.10.0 database to my dev couch. Opening it returns a new uuid. Restarting the couch will regenerate a new uuid until a write of any kind causes the db header to be written (including a compaction) at which point the uuid persists and tracks the instance. I also copied an old database, opened it, made an update, and then copied the same old database again and added .compact to the name. This acts like a partially completely compaction. The old .compact file is opened without a hitch and the uuid persists after compaction completes. Looks all good to me, now. Thanks rnewson for realizing that the interaction with compaction should be checked.
          Hide
          tilgovi Randall Leeds added a comment -

          New patch and tests.

          Show
          tilgovi Randall Leeds added a comment - New patch and tests.
          Hide
          jchris Chris Anderson added a comment -

          this patch looks good to me.

          +1 on applying it.

          Show
          jchris Chris Anderson added a comment - this patch looks good to me. +1 on applying it.
          Hide
          kocolosk Adam Kocoloski added a comment -

          This could be quite useful for replication, too, as a way to short-circuit the metadata check between copies of .couch files.

          Show
          kocolosk Adam Kocoloski added a comment - This could be quite useful for replication, too, as a way to short-circuit the metadata check between copies of .couch files.
          Hide
          rnewson Robert Newson added a comment -

          Add uuid=nil to #db_header, initialize it to a random uuid on creation, return it in db_info blob.

          Show
          rnewson Robert Newson added a comment - Add uuid=nil to #db_header, initialize it to a random uuid on creation, return it in db_info blob.

            People

            • Assignee:
              Unassigned
              Reporter:
              rnewson Robert Newson
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Development