Table of Contents |
---|
...
|
Context-level policies can be created to manage EC (erasure coding) across the cluster. Swarm ships with cluster-level EC encoding unspecified. Unless EC is specified at the object level, every object is fully replicated, regardless of size.
...
An individual object can specify EC encoding in the lifepoint header, as reps=k:p
. Add a query argument, as encoding=k:p
to override the lifepoint on an SCSP POST or PUT method. Adding the optional erasurecoded
argument overrides the active policy.ecMinStreamSize
requirement, but it cannot override an EC policy evaluating to "Disabled
".
See Lifepoint Metadata Headers for for setting lifepoints with erasure coding.
See See SCSP Query Arguments for using erasure coding query arguments.
Options for
...
Specifying EC
...
Encoding
A different EC encoding policy can be defined at the cluster and each context (domain and bucket) level, using this 2-part setting:
Part | Scope | Value ( |
---|
String) | Notes | Example | ||
---|---|---|---|---|
Encoding | Affects the current context level. Returns 400 Bad request if value is missing or out of | unspecified | Allows erasure coding at this level and below, using the available policy or cluster defaults. |
|
disabled | Disables erasure coding at current level. |
| ||
k:p {data segments}: | The specific EC encoding to use at this level.
Subject to the resolved policy's eCMinStreamSize |
| ||
Lock ( |
Optional) | Affects any contexts below | anchored | Applies this encoding to all levels below, overriding any lower-level policies. |
|
---|
EC encoding is subject to policy resolution on each write request, evaluating the object-level encoding with the context. For contexts, Swarm uses the policy at the given level unless a level above it is anchored. Swarm uses the anchored encoding.
...
Code Block | ||
---|---|---|
| ||
policy.ecEncoding = unspecified anchored |
How Swarm
...
Resolves EC
...
Policies
Swarm begins EC policy evaluation by eliminating contexts (domain and bucket) not applicable, for one of two reasons:
because Type of the type of object
because of the "
anchored
" override
Swarm (1) selects the anchored policy if it exists, or else (2) checks the relevant contexts from the bottom up and selects the first policy it finds:
...
Example EC
...
Policy Resolution
For example, consider a set of conflicting context-level policies such as this:
Cluster | Configuration setting |
|
|
---|
Domain | Persisted header |
|
|
---|
Bucket | Persisted header |
|
|
---|
The EC policy evaluation resolves differently depending on the type of object being written:
Object Type | Evaluates to | Explanation |
---|---|---|
named |
| The bucket setting is ignored because the domain setting is anchored. |
tenanted unnamed |
| The bucket setting is ignored because unnamed objects cannot reside in a bucket. The |
untenanted unnamed |
| The domain setting is ignored because untenanted objects cannot reside in a domain. |
Info |
---|
TipSee the diagram in Troubleshooting Erasure Coding to see how Swarm resolves the protection policy (whether to use erasure coding or replication) on a request. |
How to
...
View and
...
Set EC
...
Encoding Policy
EC Encoding is one of several content protection features in Swarm, all are controlled by way of policies. Swarm evaluates policies for each object based on cluster and context values:
Policy-related settings for the cluster (required)
Policy-related headers on domain and bucket objects (optional)
For setting policies at the cluster level, see seeConfiguring Cluster Policies.
Creating a policy involves changing one or both EC requirements for the given scope:
ecEncoding — - Whether to allow/prevent/change the EC encoding
ecMinStreamSize* — - Whether to change the object size triggering erasure-coding.
...
Set encoding policies with the appropriate naming and method, starting with the cluster, once decided on the encoding policy for each level:
Scope | Type | Persisted Name, SNMP MIB | Configuration Method | |||
---|---|---|---|---|---|---|
cluster | policy.ecEncoding, policyECEncoding policy.ecMinStreamSize, policyECMinStreamSize | Set the cluster parameters specific to EC encoding policy and verify the other EC-related settings. Use the snmpset command on the cluster's settings object to change and persist the cluster-wide policies. See Using SNMP with Swarm. | ||||
domain | Persisted | Policy-ECEncoding, policyECEncoding Policy-ECMinStreamSize, policyECMinStreamSize Policy-ECEncoding-Unnamed, policyECEncodingUnnamed Policy-ECMinStreamSize-Unnamed, policyECMinStreamSizeUnnamed | Use a write method (POST for new, COPY for update) on the domain object to set policy values. Use a read method (GET, HEAD) on the domain object to check policy values. Separate encoding can be specified for unnamed objects, as if they are in a separate bucket, because they are tenanted directly in domains:
| |||
bucket | Persisted | Policy-ECEncoding, policyECEncoding Policy-ECMinStreamSize, policyECMinStreamSize | Use a write method (POST for new, COPY for update) on the bucket object to set policy values. Use a read method (GET, HEAD) on the bucket object to check policy values. |
This new domain has a separate required policy for named objects (which bucket owners are not able to override), but unnamed objects follow the current cluster-level policy:
...