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.
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
You can modify the bucket property enableCrossClusterVersioning
through the REST API.
For information about modifying enableCrossClusterVersioning
through the REST API, see Example: Turning on enableCrossClusterVersioning, when Editing.
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
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.
*To set up XDCR bi-directional replication with Sync Gateway (SGW), you need to have at least a Server 7.6.6 version and SGW 4.0.0 version. However, Sync Gateway 4.0.0 is a future release version. |