Uploaded image for project: 'Couchbase Kubernetes'
  1. Couchbase Kubernetes
  2. K8S-1675

XDCR with Operator hits error when setting up with Buckets of the same name

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 2.1.0
    • None
    • kubernetes, operator
    • None
    • 39: Bk Vol. Bugs. Ptwx.
    • 1

    Description

      Description:

      When creating XDCR with source and target buckets of the same name, only 1 direction would work, the other direction would hit the following error:

       

      {"level":"error","ts":1600123046.6096296,"logger":"cluster","msg":"Status update failed","cluster":"default/cb-test","error":"admission webhook \"couchbase-operator-admission.default.svc\" denied the request: validation failure list:\nbucket travel-sample referenced by spec.bucket in couchbasereplications.couchbase.com/xdcr-test-test must exist: bucket travel-sample not found","stacktrace":"github.com/couchbase/couchbase-operator/vendor/github.com/go-logr/zapr.(*zapLogger).
       
      

       

      Steps to re-create:

      1) Create 2 clusters in the same namespace, (cb-example.yaml and cb-test.yaml)

      2) Create 2 buckets with couchbase-bucket.yaml

       apiVersion: couchbase.com/v2 
      kind: CouchbaseBucket 
      metadata: 
        name: travel-test 
        labels: 
          cluster: cb-test 
      spec: 
        name: travel-sample 
        memoryQuota: 256Mi 
        replicas: 2 
        ioPriority: low 
        evictionPolicy: valueOnly 
        conflictResolution: lww 
        enableFlush: false 
        enableIndexReplica: true 
        compressionMode: passive 
      --- 
      apiVersion: couchbase.com/v2 
      kind: CouchbaseBucket 
      metadata: 
        name: travel-sample 
        labels: 
          cluster: cb-example 
      spec: 
        name: travel-sample 
        memoryQuota: 256Mi 
        replicas: 2 
        ioPriority: low 
        evictionPolicy: valueOnly 
        conflictResolution: lww 
        enableFlush: false 
        enableIndexReplica: true 
        compressionMode: passive 
      ---

       

      3) create XDCR from cb-example to cb-test with xdcrexample.yaml

      apiVersion: couchbase.com/v2
      kind: CouchbaseReplication
      metadata:
       name: xdcr-example-test-travel
       labels:
       cluster: cb-example
      spec:
       bucket: travel-sample
       remoteBucket: travel-sample
       paused: false

      This works without issue.

      4) Create XDCR from cb-test to cb-example with xdcrtest.yaml:

      apiVersion: couchbase.com/v2
      kind: CouchbaseReplication
      metadata:
       name: xdcr-test-sample-travel
       labels:
       cluster: cb-test
      spec:
       bucket: travel-sample
       remoteBucket: travel-sample
       paused: false

      5) The operator would show this error in the logs:

      {"level":"error","ts":1600123895.1002529,"logger":"cluster","msg":"Status update failed","cluster":"default/cb-test","error":"adm
      ission webhook \"couchbase-operator-admission.default.svc\" denied the request: validation failure list:\nbucket travel-sample re
      ferenced by spec.bucket in couchbasereplications.couchbase.com/xdcr-test-sample-travel must exist: bucket travel-sample not found
      ","stacktrace":"github.com/couchbase/couchbase-operator/vendor/github.com/go-logr/zapr.(*zapLogger).
      

       

       

      The error goes away if using with a different bucket name for source or remote.

      Attachments

        1. cb-example.yaml
          2 kB
        2. cbopinfo-20200915T133936-0700.tar.gz
          818 kB
        3. cb-test.yaml
          2 kB
        4. couchbase-bucket.yaml
          0.6 kB
        5. xdcrexample.yaml
          0.2 kB
        6. xdcrtest.yaml
          0.2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            simon.murray Simon Murray
            tin.tran Tin Tran (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty