Description
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:
- 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.
- 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…
Attachments
Issue Links
- is a backport of
-
MB-34867 XDCR Compression Default auto mode is allowed in CE
- Closed