SCSP UPDATE

This section provides general information about SCSP UPDATE applying to both named and unnamed objects.

The UPDATE request is formatted as an HTTP request using the PUT method.

SCSP Method

HTTP Method

RFC 7231 Section

SCSP Method

HTTP Method

RFC 7231 Section

SCSP UPDATE

PUT

4.3.4

Special Query Arguments

replicate

Protects rapid updates

Objects can be updated at a maximum frequency of once per second. Updating more frequently can cause unpredictable results with the stored object version and can trigger an HTTP 409 (Conflict) error. Include the replicate=immediate query argument to verify more than one node returns the latest version in a subsequent read if an application updates objects faster than once per second.

newname

Renames object

Use the newname query argument to rename a named object within the same bucket, which provides a new name with the update request (PUT, COPY, APPEND). Requests for the original name return an HTTP 404 Not Found and the prior search metadata is removed after an object is renamed. Note: the newname argument also allows renaming domains and buckets.

preserve

Updates custom headers

PUT only saves new headers, but the preserve argument allows keeping the existing headers as well as save any new ones. (v9.5)

UPDATE for Named Objects

UPDATE is a request to the storage cluster to modify a specific named object or alias object with new content. The UPDATE request is formatted as an HTTP request using the PUT method:

PUT /bucket/file.txt HTTP/1.1   Host: cluster.example.com   User-Agent: Swarm Client/0.1    Content-Length: 43402    Expect: 100-continue   Content-Type: image/jpeg    Content-Language: en/us, x-pig-latin   Content-Version: 42   Last-Modified: Wed, 1 Sept 2010 15:59:02 GMT    Created-Date: Wed, 1 Sept 2010 15:59:02 GMT   CRLF   [ content ]

UPDATE for Unnamed Objects

The UPDATE request is formatted as an HTTP request using the PUT method. The normal response to a PUT request, similar to a POST, is an HTTP 201 Created response.

PUT /06eec5e2c3f1aadcb41ef7fd52adc049 HTTP/1.1   Host: cluster.example.com   User-Agent: Swarm Client/0.1    Content-Length: 43402    Expect: 100-continue   Content-Type: image/jpeg   Content-Language: en/us, x-pig-latin   Content-Version: 42   Last-Modified: Wed, 1 Sept 2010 15:59:02 GMT   Created-Date: Wed, 1 Sept 2010 15:59:02 GMT   CRLF   [ content ]

PUT returns an HTTP 404 Not Found error if the object name or UUID you specify in the command does not exist.

Note

The object can be erasure-coded, which has a smaller storage footprint, if a non-erasure-coded object is updated and the update causes the object to meet the criteria described in https://perifery.atlassian.net/wiki/spaces/public/pages/2443812123.

UPDATE for alias Objects

Adding alias=yes is optional to update alias object because this method applies only to mutable objects.

The content sent in the body of the request is written as a new object if UPDATE succeeds on an alias object. The first line of the HTTP PUT is updated to point to the new object, and the original UUID of the object is returned to the client.

Normal Responses to UPDATE

See https://perifery.atlassian.net/wiki/spaces/public/pages/edit-v2/2443821621# for a list of response headers.

Error Responses to UPDATE

Swarm responds with an HTTP 409 Conflict if the UPDATE method is executed on an object in a domain but the domain does not exist or is not in the content cache on the node that receives the request.

Rapid Updates

Rapid updates of an object can trigger an HTTP 409 Conflict error, a "Later version already exists."

Rapid updates or overwrites to an object in a versioned bucket can cause temporary listing inconsistency, even when replication=immediate is used (default with Gateway). Those unlisted versions are accessible directly by the versionid. Using a 1-second delay should avoid this.

 

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