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
Synchronous Write to Remote Sites is the same as RSW. All commands and log messages use the acronym
RSW
.
This is separate from Configuring ROW Replicate On Write , which guarantees immediate replication within the same cluster.RSW is implemented in Gateway using the SCSP SEND method. RSW requires writing to Gateway, and Gateway uses the https://caringo.atlassian.net/wiki/spaces/public/pages/2443821576 method for the Swarm nodes. This allows replicating objects normally.
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.
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.
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.
Create separate replication feeds for each of the remote Swarm clusters in the primary (source) cluster. See Replication Feeds for more details.
Navigate to Cluster > Feeds, select + Add, and select Replication in the Swarm UI.
Leave the legacy setting Propagate Deletes enabled.
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.
Set up replication feeds in the remote clusters if the remote clusters are accepting content to be mirrored back to the primary cluster.
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.
DomainsThe 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.
| |
BucketsDisable Inherit Policy and explicitly enable it for each affected bucket unless enabling synchronous write at the domain level:
|
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: