Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel2
outlinefalse
typelist
printablefalse

The Replicate on Write (ROW) option forces Swarm to write a new object to one or more additional nodes before returning a success status. Using this content protection option, verify two or more object replicas (instances) exist in the cluster before the client write request is completed.

Success

...

Conditions for ROW

These are the success conditions for a ROW request:

  • A POST on an immutable object creates at least two replicas.

  • Any write operation for an alias object, or a POST for a named object.

...

Note

The reason for treating named objects like existing alias objects is they may already exist. Allowing these writes to succeed with one replica verifies no old versions can be inadvertently deleted by the HP if the request fails with one replica.

Implementing ROW

Implement ROW in these ways:

  • Globally, set the configuration file to enabling (recommended) or disabling cluster-wide ROW. See Configuring ROW Replicate On Write.

  • Programmatically, use a replicate query argument when needing to override the cluster-wide ROW configuration.

  • Creating or updating a bucket. The replicate=immediate option quickly invalidates cached bucket versions in the cluster so the latest version is implemented in the cluster. It also prevents subsequent permission errors because out-of-date permissions are used from the prior version.

Code Block
languagebash
curl -i 
	--post301 
	--data-binary '' 
	--location-trusted 'http://172.16.0.35/bucket?domain=test.example.com&replicate=immediate' 
	-D create-bucket.log

...

Replicate Argument

Add the replicate query argument to control how Swarm implements ROW on a given request.

...

The number of replicas Swarm makes synchronously on the request cannot exceed the number of replicas specified in the lifepoint (or, if none, policy.replicas default) in every case. A request with replicate=3 causes 2 replicas to be synchronously created on the request for an object with no lifepoint specified and a cluster with default=2.

Replica-Count

...

Header

Swarm indicates the number of replica created with the request in the Replica-Count header. Check the header value in the response to verify the correct number of replicas is received.

...

A ROW request can return successfully with one replica created, it does not attempt to perform the operation if it cannot find at least two nodes up front.

Responses for

...

Replicating Objects

Swarm returns an HTTP 412 Preconditioned Failed response if Swarm is replicating an object and the cluster cannot locate at least two nodes to store the replicas initially.

...