XDCR enableCrossClusterVersioning

      +
      Enabling Cross Cluster Versioning allows XDCR to add metadata to each replicated document.

      Enabling Cross Cluster Versioning for all buckets in the replication topology is a pre-requisite for some XDCR features. The bucket property enableCrossClusterVersioning cannot be disabled once it is set to true. Therefore, you must not enable enableCrossClusterVersioning casually.

      When you set the bucket property enableCrossClusterVersioning (ECCV) to true, for each document processed by XDCR, XDCR stores additional metadata for the document in the extended attributes. This metadata is also called Hybrid Logical Vector (HLV), which is a set of Hybrid Logical Clock (HLC) information.

      Cross Cluster Versioning (ECCV) Compatibility with Couchbase Server Versions

      Starting in Couchbase Server 7.6.6, buckets include the enableCrossClusterVersioning (ECCV) property, which is set to false (disabled) by default.

      If you set ECCV to true (enabled) on a bucket in an XDCR replication topology, then you must set ECCV to true on all buckets participating in the XDCR replication topology. Otherwise, dependent features may not function.

      As the Couchbase Server versions earlier than 7.6.6 do not support the enableCrossClusterVersioning bucket property, those buckets cannot participate in a replication topology containing ECCV-enabled buckets.

      XDCR does not automatically validate ECCV property consistency across buckets. If you want to prevent a bucket without ECCV from participating in an XDCR replication topology, then before creating or modifying XDCR replications, you must manually verify that ECCV is disabled for all participating buckets.

      For more information about XDCR compatibility between different versions of Couchbase Server Enterprise edition, see XDCR Compatibility.

      Hybrid Logical Vector (HLV) Data Maintained in the Extended Attributes

      The new metadata, HLV, is stored as a system created extended attribute (xattrs) called _vv (xattrs._vv). The HLV metadata is also called Version Vectors.

      The HLV metadata takes up 109 + 40N bytes of space per document, where N is the number of buckets mutating the document in the replication topology.

      As long as your replication topology is constant, the size of the HLV metadata will grow to 109 + 40N bytes and remain constant. However, the HLV data accumulation occurs when the replication topology changes and the document copy goes through different clusters, for example, when being restored to a new cluster.

      To remove the accumulated or outdated HLV data, the HLV metadata is pruned periodically. You can control the pruning frequency by setting the bucket property versionPruningWindowHrs.

      Remove HLV Metadata

      After enabling, you cannot disable the bucket property enableCrossClusterVersioning. You can, however, backup and restore the data to a bucket where enableCrossClusterVersioning is set to false, and remove the xattrs information added by XDCR using the option cbbackupmgr restore --disable-hlv.

      To remove the on-going maintenance of HLV information, you must remove the xattrs information previously added to the documents. To completely remove the effects of enabling HLV, only restoring the data to a bucket where enableCrossClusterVersioning is set to false is not enough.

      Modify the Bucket Property enableCrossClusterVersioning

      To modify or enable the bucket property enableCrossClusterVersioning:

      You cannot enable the bucket property enableCrossClusterVersioning while creating the bucket.

      versionPruningWindowHrs

      versionPruningWindowHrs is a bucket property, which controls the pruning frequency of the HLV metadata. The default value of versionPruningWindowHrs is 720 hours (30 days), which means that any HLV data older than 720 hours is pruned to remove the outdated entries.

      versionPruningWindowHrs must be set to the same value for all buckets in an XDCR replication topology.

      Manage the bucket property versionPruningWindowHrs

      For information about modifying the bucket property versionPruningWindowHrs through REST API, see Example: Specifying time value for versionPruningWindowHrs, when Editing.

      Features for Which Cross Cluster Versioning Must Be Enabled

      • XDCR Active-Active with Sync Gateway: The bi-directional, active-active replication with Sync Gateway 4.0 or a later version and XDCR requires enabling Cross Cluster Versioning.

        For more information, including important limitations, see XDCR Active-Active with Sync Gateway.

        For more information about how Sync Gateway 4.0+ version works with Couchbase Server’s XDCR, see XDCR - Server Compatibility.

        To set up XDCR bi-directional replication with Sync Gateway (SGW), the minimum required version for Server is 7.6.6 and SGW is 4.0.0.
      • XDCR Conflict Logging: XDCR Conflict Logging requires enabling Cross Cluster Versioning. For more information, see XDCR Conflict Logging Feature.

        Only the documents mutated after the enableCrossClusterVersioning property is enabled on both the source and target clusters, are considered for conflict logging.