Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-35093

[BP MB-34867] - XDCR Compression Default auto mode is allowed in CE



    • Bug
    • Resolution: Won't Fix
    • Major
    • 5.5.6
    • 5.5.6
    • XDCR
    • None
    • Untriaged
    • No


      There are 2 Enterprise checks.


      The first one is when users actively to set compression type from REST (CLI or UI), this line is called as part of the check:


      It is called for each setting that is being passed in from REST when either replication is being changed or being created. (See adminport.go and trace from there)


      By default, when users upgrade, the default replication setting will have a compression type of Auto.


      When users create a replication without specifying a replication setting like compression, XDCR takes the default setting, which includes AUTO and then applies the rest on top of it.

      Parse only the user provided settings: https://github.com/couchbase/goxdcr/blob/f9008c24851f081856ed130ad6f7e973eb71b67e/replication_manager/adminport.go#L397

      Gets a default setting template: https://github.com/couchbase/goxdcr/blob/f9008c24851f081856ed130ad6f7e973eb71b67e/replication_manager/replication_manager.go#L703

      Then apply user provided setting on top: https://github.com/couchbase/goxdcr/blob/f9008c24851f081856ed130ad6f7e973eb71b67e/replication_manager/replication_manager.go#L722


      The combined replication setting then gets passed all the way pass admin port, and into the replication spec service validation.


      That’s where the second enterprise check occurs, here:



      The issue is, if the compression type is AUTO per default scenario above, then the AUTO setting gets wiped here:


      and I think the actual error from “Not enterprise” gets deleted, and we let the replication run.


      So it looks like CE users have been getting it for free.


      The unit test failed as expected, because we set it to force Snappy, and because Snappy != Auto, we don’t delete the errors during prerequisite check and that fails here.


      There are 2 things to be fixed:

      1. If customers are running CE and do not specify AUTO as part of the creation, then make sure regardless of the pulled default setting, the compression type in the end should be None.
      2. if it is AUTO (or snappy) and the prereq check fails with a specific error that it’s due to CE, don’t erase the error, let it fail, and block it from proceeding. This may not be necessary if #1 is there, but may as well check for it.


      It may be worthwhile to back port this too…


        Issue Links

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



              lilei.chen Lilei Chen (Inactive)
              neil.huang Neil Huang
              0 Vote for this issue
              3 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes