Setting Remote Synchronous Write (RSW)

What is Synchronous Write to Remote Sites?

Swarm's Replication Feeds are mature and resilient, with each feed syncing content iteratively and asynchronously, linking one source cluster to one target destination. Replication feeds keep target clusters continuously updated with object changes in the source cluster, and having multiple replication feeds allows the distribution of content across a set of remote Swarm clusters. Remote synchronous write is limited by inter-cluster bandwidth and the constraints of overall request timeouts. Hence, it should not be thought of as a synchronization guarantee. Remote synchronous write are built on the Swarm asynchronous feed, which acts as a safety net to ensure the eventual replication of new writes that may not have been synchronously replicated.

Starting with Swarm 12, configure individual domains and buckets to perform an object write across all remote sites at the same time. Write completion to a given bucket or domain is delayed until every remote replication is completed when remote synchronous writes are enabled. There are two situations that require synchronous write to remote sites:

  • An application requires assurance that backups (replicas) are committed to every site.

  • The content publication needs newly added content to be readable from any remote site immediately upon the write completion.

Remote Site Synchronous Write or Remote Synchronous Write is the option to have a client create or update a Swarm object and have that change committed in all active remote clusters immediately before the client receives a success code. An object written this way has the same UUID and metadata across all Swarm clusters as if it were replicated normally.

RSW

Warning

Write completion to a given bucket or domain is delayed until every remote replica is completed when remote synchronous writes are enabled. RSW might require increasing threads and maxConnections / maxConnectionsPerRoute configuration items (Gateway Configuration | [gateway]). Monitor replication status (rswfeeds) and timings (rswtime) in cloudgateway_audit.log (Gateway Logging | Audit Logging andGateway Audit Logging). Note Gateway 8.0.4 and later fixes issues with connection handling that could lead to Too many open files errors when replication fails.

Implementing Remote Targets

A remote synchronous write engages as many replication targets as are active at the time of the write. Start using remote synchronous write with one remote cluster and add additional remote clusters later. Remove or change remote sites in the future while continuing to use RSW.

  1. Complete the upgrade to Swarm 12 or higher, including the latest versions of Content Gateway, Content UI, and Swarm Storage. Current versions are required for this feature, but no additional components need to be installed.

  2. Complete provisioning and initialization for the additional remote Swarm clusters participating in remote synchronous writing.

    • Content protection policies do not need to match across all clusters. Versioning may not be enabled (which enlarges the footprint) on any but the primary cluster.

  3. Create separate replication feeds for each of the remote Swarm clusters in the primary (source) cluster. See Replication Feeds for more details.

    1. Navigate to Cluster > Feeds, select + Add, and select Replication in the Swarm UI.

    2. Leave the legacy setting Propagate Deletes enabled.

    3. Choose Replicate via direct POST rather than the legacy GET mode for the remote cluster's Replication Mode.

Note

Replication-type feeds with a Status of Active participate in RSW if enabled.

  1. Set up replication feeds in the remote clusters if the remote clusters are accepting content to be mirrored back to the primary cluster.

  2. Verify that the feeds are running successfully in each of the target clusters, populating objects from the source cluster.

Enabling Remote Synchronous Writes

Click the Settings (gear icon) and set the Properties to be in force for that domain or bucket in the Content UI. The policy change takes effect on Save.

Constraints: As with the Storage Policies (replicas, encoding, versioning) for domains and buckets, this setting is constrained by the cluster's configuration. The constraints are whether the cluster has any replication feeds that are configured and whether they are in Active status for Remote Sites; no synchronous writes occur if there are not any remote clusters being replicated.

Domains

The option must be enabled at this level if synchronous writes to remote sites to include unnamed objects (which do not reside in buckets) is desired.

The best practice is to enable the option at the level of those buckets if synchronous writes for certain buckets are desired.

  • Synchronous Write Enabled: Toggle to explicitly enable or discontinue the feature.

    • For a domain, enabling it means that each of its buckets also default to having it enabled, unless inheritance is overridden.

Buckets

Disable Inherit Policy and explicitly enable it for each affected bucket unless enabling synchronous write at the domain level:

  • Inherit Policy: (default) Select to accept the domain's policy, which is disabled by default until the domain explicitly enables it.

    • With inheritance off, the bucket does not respond to domain-level changes. 

  • Synchronous Write - Enabled: Toggle to explicitly enable or disable the feature.

Managing RSW Manually

Manage and verify remote synchronous write settings from the command line:

  • To enable remote synchronous write, run a curl command that specifies one domain or bucket that is included in remote synchronous writes:

    curl -X PUT http://<Gateway>/_admin/manage/tenants/_system/domains/<domain>/rsw?state=enabled --anyauth -u admin:password  curl -X PUT http://<Gateway>/_admin/manage/tenants/_system/domains/<domain>/buckets/<bucket>/rsw?state=enabled --anyauth -u admin:password 

    Repeat the RSW enabling command on each remaining domain and/or bucket that is part of remote synchronous write.

  • To disable remote synchronous write from the command line, run a curl command that specifies one domain or bucket that is excluded in remote synchronous writes:

    curl -X PUT http://<Gateway>/_admin/manage/tenants/_system/domains/<domain>/rsw?state=disabled --anyauth -u admin:password  curl -X PUT http://<Gateway>/_admin/manage/tenants/_system/domains/<domain>/buckets/<bucket>/rsw?state=disabled --anyauth -u admin:password 
  • To inherit the domain setting again after having had it disabled on the bucket, change the state back to unset:

    curl -X PUT http://<Gateway>/_admin/manage/tenants/_system/domains/<domain>/buckets/<bucket>/rsw?state=unset --anyauth -u admin:password 
  • To verify the RSW status of a given domain or bucket, run the RSW command:

Logging for Remote Writes

A file is completely written to the original cluster and then sent to the remote clusters before the client is notified of completion, so this incurs some latency for the request when a large file is written with remote synchronization. The new object is accessible from the source cluster even if errors prevent immediate replication in any remote clusters.

In Gateway log messages, find Remote Synchronous Write statuses by looking for the prefix "RSW: ". 

At the Info level of logging, a remote replication report displays:

When enabling Debug levels (see Gateway Logging), view all detail statuses, which show that the remote writes are resolved before the RSW completes:

The feed numbers refer to the ID field of the feed definition.  Feed-1-Status = <number> is a count; how many objects are remaining for the feed to handle.

  • 0 means the feed is empty (completed).

  • 1 means a timeout occurred.

  • 2 or higher indicates an error.

The RSW result is 1/2 or 0/2 instead of 2/2 if anything remains in the feed that cannot be remotely written.

 

© DataCore Software Corporation. · https://www.datacore.com · All rights reserved.