doc-exports/docs/obs/s3api/en-us_topic_0125560365.html
Jawei, Li 1a4c1a720a OBS s3api 2.0.38.SP5
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Jawei, Li <lijiawei5@huawei.com>
Co-committed-by: Jawei, Li <lijiawei5@huawei.com>
2022-11-16 14:51:13 +00:00

30 lines
11 KiB
HTML

<a name="EN-US_TOPIC_0125560365"></a><a name="EN-US_TOPIC_0125560365"></a>
<h1 class="topictitle1">Concurrent Operation Consistency</h1>
<div id="body14938113"><p id="EN-US_TOPIC_0125560365__p11345184116914">If there is a successful response to a write or deletion request sent by a client, the client can obtain the latest data. If a write operation times out, or the server returns HTTP response error code <strong id="EN-US_TOPIC_0125560365__b143455412911">500</strong> or <strong id="EN-US_TOPIC_0125560365__b15345154115913">503</strong>, the follow-up read operations may fail. If such an error occurs, query whether the data has been successfully uploaded to the server. If not, upload the data again.</p>
<p id="EN-US_TOPIC_0125560365__p1234513411296">If multiple clients simultaneously upload, query, or delete the same object or bucket, these operations may reach the system at different times and have different latency periods. The results that return may also be different than those expected. For example, if multiple clients simultaneously upload the same object, a new upload request will replace the prior one. If you want to prevent an object from being simultaneously accessed, you must add a lock mechanism for the object in upper-layer applications.</p>
<div class="section" id="EN-US_TOPIC_0125560365__section61882160"><h4 class="sectiontitle">Concurrent Operation Examples</h4><p id="EN-US_TOPIC_0125560365__p1712819117106">The following provides eight concurrent operation examples.</p>
<ol id="EN-US_TOPIC_0125560365__ol2027613"><li id="EN-US_TOPIC_0125560365__fig4459805310921">At the same time as <strong id="EN-US_TOPIC_0125560365__b19671533113">Client 2</strong> is uploading object <strong id="EN-US_TOPIC_0125560365__b99678312110">v1</strong>, <strong id="EN-US_TOPIC_0125560365__b1796716361110">Client 1</strong> is uploading object <strong id="EN-US_TOPIC_0125560365__b19671311112">v2</strong> with the same name. After the object data is successfully uploaded, both <strong id="EN-US_TOPIC_0125560365__b59679315114">Client1</strong> and <strong id="EN-US_TOPIC_0125560365__b12967123111114">Client 2</strong> can access the latest object <strong id="EN-US_TOPIC_0125560365__b39678311114">v2</strong>, as shown in <a href="#EN-US_TOPIC_0125560365__fig6178193513458">Figure 1</a>.<div class="fignone" id="EN-US_TOPIC_0125560365__fig6178193513458"><a name="EN-US_TOPIC_0125560365__fig6178193513458"></a><a name="fig6178193513458"></a><span class="figcap"><b>Figure 1 </b>Concurrent uploading of the same object</span><br><span><img id="EN-US_TOPIC_0125560365__image101791935104511" src="en-us_image_0125560380.png" title="Click to enlarge" class="imgResize"></span></div>
</li><li id="EN-US_TOPIC_0125560365__fig3299670821312">At the same time as <strong id="EN-US_TOPIC_0125560365__b20113619117">Client 2</strong> is uploading object <strong id="EN-US_TOPIC_0125560365__b6183601120">v1</strong> and before metadata is written, <strong id="EN-US_TOPIC_0125560365__b11133611118">Client 1</strong> deletes an object with the same name. The uploading operation of <strong id="EN-US_TOPIC_0125560365__b131143621111">Client 1</strong> is still successful, and both <strong id="EN-US_TOPIC_0125560365__b5117368116">Client 1</strong> and <strong id="EN-US_TOPIC_0125560365__b51173611117">Client 2</strong> can access object <strong id="EN-US_TOPIC_0125560365__b111143616119">v1</strong>, as shown in <a href="#EN-US_TOPIC_0125560365__fig5428132211462">Figure 2</a>.<div class="fignone" id="EN-US_TOPIC_0125560365__fig5428132211462"><a name="EN-US_TOPIC_0125560365__fig5428132211462"></a><a name="fig5428132211462"></a><span class="figcap"><b>Figure 2 </b>Concurrent uploading and deletion of the same object (1)</span><br><span><img id="EN-US_TOPIC_0125560365__image18429922204616" src="en-us_image_0125560429.png" title="Click to enlarge" class="imgResize"></span></div>
</li><li id="EN-US_TOPIC_0125560365__fig25082997203710">At the same time as <strong id="EN-US_TOPIC_0125560365__b17716329161210">Client 2</strong> has successfully uploaded object <strong id="EN-US_TOPIC_0125560365__b271612911125">v1</strong> and while metadata is still being written, <strong id="EN-US_TOPIC_0125560365__b177162029121217">Client 1</strong> deletes an object with the same name. The uploading operation of <strong id="EN-US_TOPIC_0125560365__b117161029161210">Client 1</strong> is still successful, but when <strong id="EN-US_TOPIC_0125560365__b971617296127">Client 1</strong> and <strong id="EN-US_TOPIC_0125560365__b5716142961215">Client 2</strong> attempt to download the object, an error may display indicating that the object does not exist, as shown in <a href="#EN-US_TOPIC_0125560365__fig14719183104719">Figure 3</a>.<div class="fignone" id="EN-US_TOPIC_0125560365__fig14719183104719"><a name="EN-US_TOPIC_0125560365__fig14719183104719"></a><a name="fig14719183104719"></a><span class="figcap"><b>Figure 3 </b>Concurrent uploading and deletion of the same object (2)</span><br><span><img id="EN-US_TOPIC_0125560365__image972018374711" src="en-us_image_0125560488.png" title="Click to enlarge" class="imgResize"></span></div>
</li><li id="EN-US_TOPIC_0125560365__fig402823822155">At the same time as <strong id="EN-US_TOPIC_0125560365__b973313231319">Client 1</strong> is downloading an object, <strong id="EN-US_TOPIC_0125560365__b073372121314">Client 2</strong> is deleting an object with the same name. <strong id="EN-US_TOPIC_0125560365__b273302101315">Client 1</strong> may download complete object data, or may download only a part of data. After <strong id="EN-US_TOPIC_0125560365__b773316218133">Client 2</strong> receives a deletion success message, the attempt to download the object will fail, and an error will return indicating that the object does not exist, as shown in <a href="#EN-US_TOPIC_0125560365__fig164294324717">Figure 4</a>.<div class="fignone" id="EN-US_TOPIC_0125560365__fig164294324717"><a name="EN-US_TOPIC_0125560365__fig164294324717"></a><a name="fig164294324717"></a><span class="figcap"><b>Figure 4 </b>Concurrent downloading and deletion of the same object</span><br><span><img id="EN-US_TOPIC_0125560365__image1242184311473" src="en-us_image_0125560469.png" title="Click to enlarge" class="imgResize"></span></div>
</li><li id="EN-US_TOPIC_0125560365__fig37505701165838">At the same time as <strong id="EN-US_TOPIC_0125560365__b1869019277137">Client 1</strong> is downloading an object, <strong id="EN-US_TOPIC_0125560365__b19690182761319">Client 2</strong> is updating an object with the same name. <strong id="EN-US_TOPIC_0125560365__b56905279133">Client 1</strong> may download complete object data, or may download only a part of data. After <strong id="EN-US_TOPIC_0125560365__b9690927121317">Client 2</strong> receives an update success message, the attempt to download the object will succeed, and the latest data will return, as shown in <a href="#EN-US_TOPIC_0125560365__fig10267624174815">Figure 5</a>.<div class="fignone" id="EN-US_TOPIC_0125560365__fig10267624174815"><a name="EN-US_TOPIC_0125560365__fig10267624174815"></a><a name="fig10267624174815"></a><span class="figcap"><b>Figure 5 </b>Concurrent downloading and updating of the same object</span><br><span><img id="EN-US_TOPIC_0125560365__image1026720243487" src="en-us_image_0125560437.png" title="Click to enlarge" class="imgResize"></span></div>
</li><li id="EN-US_TOPIC_0125560365__li65684934915">At the same time as <strong id="EN-US_TOPIC_0125560365__b16680725124914">Client 1</strong> is uploading part <strong id="EN-US_TOPIC_0125560365__b1068112511499">v2</strong> of an object, <strong id="EN-US_TOPIC_0125560365__b11682112514497">Client 2</strong> is uploading part <strong id="EN-US_TOPIC_0125560365__b0683102512495">v1</strong> of the same object. After part <strong id="EN-US_TOPIC_0125560365__b12683102510493">v2</strong> is uploaded successfully, both <strong id="EN-US_TOPIC_0125560365__b11684725184911">Client 1</strong> and <strong id="EN-US_TOPIC_0125560365__b268413250495">Client 2</strong> can list the information about the multipart whose entity tag (ETag) is part <strong id="EN-US_TOPIC_0125560365__b2685102518493">v2</strong>, as shown in <a href="#EN-US_TOPIC_0125560365__fig191241454495">Figure 6</a>.<div class="fignone" id="EN-US_TOPIC_0125560365__fig191241454495"><a name="EN-US_TOPIC_0125560365__fig191241454495"></a><a name="fig191241454495"></a><span class="figcap"><b>Figure 6 </b>Concurrently uploading the same multipart of the same object</span><br><span><img id="EN-US_TOPIC_0125560365__image71251745124912" src="en-us_image_0125560341.png" title="Click to enlarge" class="imgResize"></span></div>
</li><li id="EN-US_TOPIC_0125560365__li16553419185013">If a client uploads an object and a timeout occurs or error code <strong id="EN-US_TOPIC_0125560365__b1099252595016">500</strong> or <strong id="EN-US_TOPIC_0125560365__b099362510504">503</strong> is returned, one of the following symptoms will occur in a subsequent object downloading and listing operation:<ul id="EN-US_TOPIC_0125560365__ul8993825145018"><li id="EN-US_TOPIC_0125560365__li18993162575017">If the object fails to be uploaded, the object cannot be downloaded and is not in the object list.</li><li id="EN-US_TOPIC_0125560365__li12994925125016">If the object upload operation times out, there is an extremely low possibility that the head operation on the object is normal, but the 500 error code is reported for an attempt to download this object. In this case, please upload the object again.</li><li id="EN-US_TOPIC_0125560365__li499582535019">If the object is newly created, it is not in the object list but can be downloaded using its name.</li><li id="EN-US_TOPIC_0125560365__li3995925105016">If the object is overwritten, its listed information, such as the size, ETag, creation time, and owner, is inconsistent with that obtained when you download it.</li></ul>
</li><li id="EN-US_TOPIC_0125560365__li10368153912505">If <strong id="EN-US_TOPIC_0125560365__b375934475016">Client 1</strong> uploads object <strong id="EN-US_TOPIC_0125560365__b67591944115014">v1</strong> and <strong id="EN-US_TOPIC_0125560365__b1275924425011">Client 2</strong> uploads object <strong id="EN-US_TOPIC_0125560365__b107591447507">v2</strong> with the same name concurrently, and status code <strong id="EN-US_TOPIC_0125560365__b076054425012">200</strong> is returned, one of the following symptoms will occur in a subsequent object downloading and listing operation:<ul id="EN-US_TOPIC_0125560365__ul1976124445014"><li id="EN-US_TOPIC_0125560365__li0761134417505">Object v1 is downloaded and listed.</li><li id="EN-US_TOPIC_0125560365__li147626448501">Object v2 is downloaded and listed.</li><li id="EN-US_TOPIC_0125560365__li15763244205012">Object v1 is downloaded while object v2 is displayed in the object list.</li><li id="EN-US_TOPIC_0125560365__li476464485012">Object v2 is downloaded while object v1 is displayed in the object list.</li></ul>
</li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0031665984.html">Introduction</a></div>
</div>
</div>
<script language="JavaScript">
<!--
image_size('.imgResize');
var msg_imageMax = "view original image";
var msg_imageClose = "close";
//--></script>