Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major 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. 0001-add-uuid-to-database-on-creation-return-it-in-db_in.patch
        2 kB
        Robert Newson
      2. db_uuids.patch
        4 kB
        Randall Leeds
      3. db_uuids.patch
        4 kB
        Randall Leeds
      4. db_uuids_v2.patch
        5 kB
        Randall Leeds

        Issue Links

          Activity

          Hide
          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
          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.
          Hide
          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
          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
          Chris Anderson added a comment -

          this patch looks good to me.

          +1 on applying it.

          Show
          Chris Anderson added a comment - this patch looks good to me. +1 on applying it.
          Hide
          Randall Leeds added a comment -

          New patch and tests.

          Show
          Randall Leeds added a comment - New patch and tests.
          Hide
          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
          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
          Randall Leeds added a comment -

          Blocked until we sort out the discussion in COUCHDB-782

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

            People

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

              Dates

              • Created:
                Updated:

                Development