Versions Compared

Key

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

Use optional lifepoint headers to define object-specific Swarm replication and retention policies with varying complexity as the situation requires.

See SCSP Headers.

Understanding Storage Policies

...

Constraints can also be grouped together and provided an expiration date. This type of constraint group is called a lifepoint because it represents a point where the health requirements of an object change. A sequence of lifepoints are collectively called a storage policy or a content lifecycle.

Lifepoints to

...

Prevent Deletion

Insert excerpt
Allow Metadata Header
Allow Metadata Header
nopaneltrue

An important use of lifepoints is to protect objects from deletion. Deleting a bucket containing such protected objects generates errors and orphans those named objects.

Infotip

Best

practice

Practice

Make the bucket object indelible if maintaining a bucket for indelible objects.

See "DELETE for domains and buckets" in  SCSP DELETE.

Lifecycle

...

Evaluation Example

Consider an object written to Swarm on June 12, 2015. The object must have at least three replicas and cannot be deleted by any user in the first six months since creation. The object needs two replicas and client applications can delete the object in the second six months since creation. The object is deleted after a year.

Complete

...

Lifecycle Policy
info
Code Block
languagexml
Lifepoint: [Wed, 12 Dec 2015 15:59:02 GMT] reps=3, deletable=no 
Lifepoint: [Sun, 08 Jun 2016 15:59:02 GMT] reps=2, deletable=yes 
Lifepoint: [] delete

Note

There is one instance of the object if there is one replica of an object in a cluster. Replica and instance are synonymous in this context.

Each time the Health Processor (HP) examines the object it checks the current date to determine how to apply the lifepoint policies:

Time

frame

Frame

Lifepoint Effects

Notes

Before the first lifepoint date

Swarm refuses SCSP DELETE requests.

HP maintains at least three replicas of the object in the cluster.


Between the first and second lifepoint dates

Swarm accepts SCSP DELETE requests.

HP allows the number of replicas in the cluster to decrease.

Now the lifepoint specifies the deletable constraint enables a client to delete the content by sending an SCSP DELETE message with the object's name or UUID

Afterthe second lifepoint date

Swarm accepts SCSP DELETE requests.

HP deletes the object at the first checkup.

The last lifepoint with no end date is in effect indefinitely once it comes in range.

Specifying Lifepoints and Lifecycles

...

Code Block
languagexml
lifepoint = "lifepoint" ":" end-date 1#constraint end-date = "[" [HTTP-date] "]" 
	constraint = replication-constraint | delete-constraint | deletable-constraint replication-constraint = 
		"reps" ["=" (1*DIGIT | 1*DIGIT:1*DIGIT)] delete-constraint = "delete" ["=" ("yes" | "no")] 
			deletable-constraint = "deletable" ["=" ("yes" | "no")]

Guidelines for

...

Lifepoints

Follow these guidelines when creating a lifepoint:

Guideline

Explanation

Make every lifepoint stand alone

Lifepoints do not build upon one another. They stand alone as a complete specification of the constraints that apply to the object in a provided date range. Include the complete set of constraints for a provided end date in the lifepoint header.

Correct
lifepoint
Lifepoint
Code Block
languagexml
Lifepoint: [] reps=1,deletable=no

Provide time in GMT

Adhere to the Full Date Section 3.3.1 of the HTTP/1.1 specification for HTTP-date. The indicated time must be specified in Greenwich Mean Time (GMT). GMT is exactly equal to UTC (Coordinated Universal Time) when dealing with Swarm.

Do not use deletable= without reps=

The delete constraint does not store a value and cannot include end-date :

Incorrect
delete constraint
Delete Constraint
Code Block
languagexml
Lifepoint: [] reps=1
Lifepoint: [] deletable=no

Do not delete contexts by lifepoint

Swarm does not allow lifepoint-triggered deletes of contexts (domains and bucket objects) to protect content objects from being orphaned.

See SCSP DELETE for guidance on deleting domains and buckets.

Do not replicate chunked uploads

Chunked uploads are erasure-coded automatically. A request fails if chunked and the current lifepoint specifies replication.

Specify two lifepoints to convert a chunked upload. Have the first specify an EC encoding expiring in one day and have the second specify the number of replicas going forward:

Converting
chunked
Chunked to
replication
Replication
Code Block
languagexml
Transfer-Encoding: chunked
Lifepoint: [Wed, 12 Dec 2016 15:59:02 GMT] reps=5:2 
Lifepoint: [] reps=3

Do not expect Swarm to validate lifepoints

Swarm does not validate lifepoints when they are added to the cluster to maximize performance. Swarm accepts an invalid lifepoint and later logs an error if the HP cannot parse the lifepoint.

Constraints for Replication and Deletion

...

  • Replicas – Place limits on the number of replicas that can be specified by defining policy.replicas min and max

  • EC – Specify the ec.minParity to verify all objects have a minimum number of parity segments included for protection. Invalid or conflicting values of the reps constraint are ignored, defaults are used, and warnings are written to the log if found in a lifepoint. Lifepoints with erasure coding define what EC level to apply. For example: lifepoint = [] reps=5:2 expresses an erasure-coded level of 5 data segments and 2 parity segments.

Supported conversion methodsConversion Methods

A storage policy with multiple lifepoints including the following conversion methods are supported as of v6.5:

...

Delete must be the sole constraint in a lifepoint when present because other conditions on a deleted object may not be applicable. A delete lifepoint must be specified with an empty end date.

Incorrect

...

Delete Constraint
Code Block
languagexml
Lifepoint: [Wed, 08 Jun 2012 15:59:02 GMT] reps=3, deletable=no, delete
Correct

...

Delete Constraint
Code Block
languagexml
Lifepoint: [Fri, 12 Dec 2011 15:59:02 GMT] reps=3, deletable=no 
Lifepoint: [] delete

...