forked from docs/doc-exports
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com> Co-authored-by: zhangyue <zhangyue164@huawei.com> Co-committed-by: zhangyue <zhangyue164@huawei.com>
53 lines
9.4 KiB
HTML
53 lines
9.4 KiB
HTML
<a name="en-us_topic_0045853504"></a><a name="en-us_topic_0045853504"></a>
|
|
|
|
<h1 class="topictitle1">Versioning Overview</h1>
|
|
<div id="body1499753333227"><p id="en-us_topic_0045853504__p374203118391">OBS can store multiple versions of an object. You can quickly search for and restore different versions or restore data in the event of accidental deletions or application faults.</p>
|
|
<p class="MsoNormal" id="en-us_topic_0045853504__p42062747">By default, the versioning function is disabled for new buckets on OBS. Therefore, if you upload an object to a bucket where an object with the same name exists, the new object will overwrite the existing one.</p>
|
|
<div class="section" id="en-us_topic_0045853504__section267316284432"><h4 class="sectiontitle">Enabling Versioning</h4><ul id="en-us_topic_0045853504__ul61783529"><li id="en-us_topic_0045853504__li15302161193620">Enabling versioning does not change the versions and contents of existing objects in the bucket. The version ID of an object is <strong id="en-us_topic_0045853504__b269016816181">null</strong> before versioning is enabled. If a namesake object is uploaded after versioning is enabled, a version ID will be assigned to the object. For details, see <a href="#en-us_topic_0045853504__fig2477115284615">Figure 1</a>.<div class="fignone" id="en-us_topic_0045853504__fig2477115284615"><a name="en-us_topic_0045853504__fig2477115284615"></a><a name="fig2477115284615"></a><span class="figcap"><b>Figure 1 </b>Versioning (with existing objects)</span><br><span><img id="en-us_topic_0045853504__image178651329583" src="en-us_image_0135709734.png"></span></div>
|
|
</li><li id="en-us_topic_0045853504__li37064421458">OBS automatically allocates a unique version ID to a newly uploaded object. Objects with the same name are stored in OBS with different version IDs.<div class="fignone" id="en-us_topic_0045853504__fig313745516351"><span class="figcap"><b>Figure 2 </b>Versioning (for new objects)</span><br><span><img id="en-us_topic_0045853504__image4315816155813" src="en-us_image_0135263079.png"></span></div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0045853504__table049033015373" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Version description</caption><thead align="left"><tr id="en-us_topic_0045853504__row154903306372"><th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.3.2.2.2.2.3.1.1"><p id="en-us_topic_0045853504__p15490163043717">Version</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="79%" id="mcps1.3.3.2.2.2.2.3.1.2"><p id="en-us_topic_0045853504__p649011306374">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="en-us_topic_0045853504__row184901130183714"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.2.2.2.2.3.1.1 "><p id="en-us_topic_0045853504__p14490930133716">Latest version</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="79%" headers="mcps1.3.3.2.2.2.2.3.1.2 "><p id="en-us_topic_0045853504__p15490183083718">After versioning is enabled, each operation on an object will result in saving of the object with a new version ID. The version ID generated upon the latest operation is called the latest version.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="en-us_topic_0045853504__row16490143043711"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.2.2.2.2.3.1.1 "><p id="en-us_topic_0045853504__p149053010375">Historical version</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="79%" headers="mcps1.3.3.2.2.2.2.3.1.2 "><p id="en-us_topic_0045853504__p1349018308373">After versioning is enabled, each operation on an object will result in saving of the object with a new version ID. Version IDs generated upon operations other than the latest operation are called historical versions.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li><li id="en-us_topic_0045853504__li11906947104610">The latest objects in a bucket are returned by default after a GET Object request.</li><li id="en-us_topic_0045853504__li5044213017308">Objects can be downloaded by version IDs. By default, the latest object is downloaded if the version ID is not specified. For details, see <a href="obs_03_0327.html#obs_03_0327__section29772226">Related Operations</a> in <a href="obs_03_0327.html">Configuring Versioning</a>.</li><li id="en-us_topic_0045853504__li1922972904812">You can select an object and click <strong id="en-us_topic_0045853504__b1439112892814">Delete</strong> on the right to delete the object. After the object is deleted, OBS generates a <strong id="en-us_topic_0045853504__b887102583116">Delete Marker</strong> with a unique version ID for the deleted object, and the deleted object is displayed in the <strong id="en-us_topic_0045853504__b982755722818">Deleted Objects</strong> list. For details, see <a href="en-us_topic_0045853756.html">Deleting an Object or Folder</a>. The 404 error will be returned if attempts are made to access this deleted object.<div class="fignone" id="en-us_topic_0045853504__fig12513111686"><span class="figcap"><b>Figure 3 </b>Object with a delete marker</span><br><span><img id="en-us_topic_0045853504__image106810213564" src="en-us_image_0135698309.png"></span></div>
|
|
</li><li id="en-us_topic_0045853504__li16974139482">You can recover a deleted object by deleting the delete marker. For details, see <a href="en-us_topic_0066176932.html#en-us_topic_0066176932__section27691114163422">Related Operations</a> in <a href="en-us_topic_0066176932.html">Undeleting an Object</a>.</li><li id="en-us_topic_0045853504__li65671427483">After an object is deleted, you can specify the version number in <strong id="en-us_topic_0045853504__b202463427396">Deleted Objects</strong> to permanently delete the object of the specified version. For details, see <a href="en-us_topic_0045853756.html#en-us_topic_0045853756__section089519314196">Related Operations</a> in <a href="en-us_topic_0045853756.html">Deleting an Object or Folder</a>.</li><li id="en-us_topic_0045853504__li185772028101011">An object is displayed either in the object list or the list of deleted objects. It will never be displayed in both the lists at the same time.<p id="en-us_topic_0045853504__p11578112817100"><a name="en-us_topic_0045853504__li185772028101011"></a><a name="li185772028101011"></a>For example, after object <strong id="en-us_topic_0045853504__b153159177404">A</strong> is uploaded and deleted, it will be displayed in the <strong id="en-us_topic_0045853504__b113718469401">Deleted Objects</strong> list. If you upload an object named <strong id="en-us_topic_0045853504__b109891246104011">A</strong> again, the object <strong id="en-us_topic_0045853504__b1991114619403">A</strong> will be displayed in the <strong id="en-us_topic_0045853504__b92871340114115">Objects</strong> list, and the previously deleted object <strong id="en-us_topic_0045853504__b149921646144011">A</strong> will no longer be displayed in the <strong id="en-us_topic_0045853504__b585482374119">Deleted Objects</strong> list. For details, see <a href="#en-us_topic_0045853504__fig1469714544377">Figure 4</a>.</p>
|
|
<div class="fignone" id="en-us_topic_0045853504__fig1469714544377"><a name="en-us_topic_0045853504__fig1469714544377"></a><a name="fig1469714544377"></a><span class="figcap"><b>Figure 4 </b>Uploading a namesake object after the original one is deleted</span><br><span><img id="en-us_topic_0045853504__image7901510165611" src="en-us_image_0135706002.png"></span></div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="en-us_topic_0045853504__section11792633194415"><h4 class="sectiontitle">Suspending Versioning</h4><p id="en-us_topic_0045853504__p19731415440">Once the versioning function is enabled, it can be suspended but cannot be disabled. Once versioning is suspended, version IDs will no longer be allocated to newly uploaded objects. If an object with the same name already exists and does not have a version ID, the object will be overwritten.</p>
|
|
<div class="fignone" id="en-us_topic_0045853504__fig997719201937"><span class="figcap"><b>Figure 5 </b>Object versions in the scenario when versioning is suspended</span><br><span><img id="en-us_topic_0045853504__image2468523195917" src="en-us_image_0135715557.png" title="Click to enlarge" class="imgResize"></span></div>
|
|
<p id="en-us_topic_0045853504__p15453151459">If versions of objects in a bucket do not need to be controlled, you can suspend the versioning function.</p>
|
|
<ul id="en-us_topic_0045853504__ul59456295"><li id="en-us_topic_0045853504__li65344610">Historical versions will be retained in OBS. If you do not need these historical versions, manually delete them.</li><li id="en-us_topic_0045853504__li51230581">Objects can be downloaded by version IDs. By default, the latest object is downloaded if the version ID is not specified.</li></ul>
|
|
</div>
|
|
<div class="section" id="en-us_topic_0045853504__section135901320145020"><h4 class="sectiontitle">Differences Between Scenarios When Versioning Is Suspended and Disabled</h4><p id="en-us_topic_0045853504__p162733446142">If you delete an object after versioning is suspended for the bucket, a delete marker will be generated, no matter whether the object has historical versions. But, if versioning is disabled, the same operation will not generate a delete marker.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0045853849.html">Versioning</a></div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script language="JavaScript">
|
|
<!--
|
|
image_size('.imgResize');
|
|
var msg_imageMax = "view original image";
|
|
var msg_imageClose = "close";
|
|
//--></script> |