Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-630

Validate whether multiple databases connect to the same bucket

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 2.8.0
    • 2.6.1
    • SyncGateway
    • Security Level: Public
    • None
    • CBG Sprint 38, CBG Sprint 39
    • 3

    Description

      Currently it's possible to define a Sync Gateway config where you have multiple databases connected to the same backend bucket, e.g.:

      {
        "logging": {
          "console": {
            "log_keys": ["*"]
          }
        },
        "databases": {
          "db": {
            "server": "couchbase://localhost",
            "username": "Administrator",
            "password": "password",
            "bucket": "default",
            "users": { "GUEST": { "disabled": false, "admin_channels": ["*"] } },
            "allow_conflicts": false,
            "revs_limit": 20,
            "num_index_replicas": 0
          },
          "db2": {
            "server": "couchbase://localhost",
            "username": "Administrator",
            "password": "password",
            "bucket": "default",
            "users": { "GUEST": { "disabled": false, "admin_channels": ["*"] } },
            "allow_conflicts": false,
            "revs_limit": 20,
            "num_index_replicas": 0
          }
        }
      }
      

      This is a bad idea as (as far as I know) this is untested and is likely to cause issues with overlapping DCP streams.
      Additionally, you could end up in a situation where both databases have different Sync Functions, which could then cause real havoc, particularly if they are both trying to import.

      Would be good to try and avoid this behavior if possible by refusing to start if this situation is detected (maybe have to compare bucket UUIDs?).

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sarath.kumarsivan Sarath Kumar Sivan (Inactive)
            matt.carabine Matt Carabine (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty