forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
162 lines
18 KiB
HTML
162 lines
18 KiB
HTML
<a name="EN-US_TOPIC_0000001460721144"></a><a name="EN-US_TOPIC_0000001460721144"></a>
|
|
|
|
<h1 class="topictitle1">Functions for Deleting Residual Files</h1>
|
|
<div id="body32001227"><div class="note" id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_note2394732143016"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_en-us_topic_0000001494853537_p11746104245120">The pgxc residual file management function only operates on the CN and the current primary DN, and does not verify or clear residual files on the standby DN. Therefore, after the primary DN is cleared, you need to clear residual files on the standby DN or build the standby DN in a timely manner. This prevents residual files on the standby DN from being copied back to the primary DN due to incremental build after a primary/standby switchover.</p>
|
|
</div></div>
|
|
<div class="section" id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_section16677221145"><h4 class="sectiontitle">pg_rm_residualfiles(filepath)</h4><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p65832219149">Description: Deletes files from a specified residual file list on the current instance. This function is an instance-level function and is irrelevant to the current database. It can run on any instance.</p>
|
|
<p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p1358102261411">Parameter type: text</p>
|
|
<p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p1959322161417">Return type: record</p>
|
|
<p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p0591522191418">The following table describes return columns.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_table360102217143" frame="border" border="1" rules="all"><caption><b>Table 1 </b>pg_rm_residualfiles (filepath) return fields</caption><thead align="left"><tr id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_row145913225146"><th align="left" class="cellrowborder" valign="top" width="19.07%" id="mcps1.3.2.6.2.4.1.1"><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p13591022131411">Column</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="21.02%" id="mcps1.3.2.6.2.4.1.2"><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p559172241416">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="59.91%" id="mcps1.3.2.6.2.4.1.3"><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p1459182211147">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_row126082216149"><td class="cellrowborder" valign="top" width="19.07%" headers="mcps1.3.2.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p359202215147">result</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.02%" headers="mcps1.3.2.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p10592223142">bool</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.3.2.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p659622101415">Deletion completed or not</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p1160102213146">Example:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_screen76014229144"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">pg_rm_residualfiles</span><span class="p">(</span><span class="s1">'pgrf_20200908160211441599'</span><span class="p">);</span>
|
|
<span class="w"> </span><span class="k">result</span><span class="w"> </span>
|
|
<span class="c1">--------</span>
|
|
<span class="w"> </span><span class="n">t</span>
|
|
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
<div class="note" id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_note14601122111411"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_ul8662113374914"><li id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_li96623336492">Residual files can be deleted only after verification using the pg_verify_residualfiles() function.</li><li id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_li26621233194916">All verified files, regardless which database they are in, will be deleted.</li><li id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_li96624333499">If all files recorded in the specified file have been deleted, the specified file will be removed and backed up in the <strong id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_b15216374472220">$PGDATA/pg_residualfile/backup</strong> directory.</li></ul>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_section1648363151413"><h4 class="sectiontitle">pg_rm_residualfiles()</h4><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p14476103110144">Description: Deletes all files recorded on all residual file lists on the current instance. This function is an instance-level function and is irrelevant to the current database. It can run on any instance.</p>
|
|
<p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p1847653171412">Parameter type: none</p>
|
|
<p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p847663111142">Return type: record</p>
|
|
<p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p1747693115144">The following table describes return columns.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_table1447810318143" frame="border" border="1" rules="all"><caption><b>Table 2 </b>pg_rm_residualfiles () return fields</caption><thead align="left"><tr id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_row1247673111414"><th align="left" class="cellrowborder" valign="top" width="19.09%" id="mcps1.3.3.6.2.4.1.1"><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p8476031121412">Column</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.3.6.2.4.1.2"><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p9476631161415">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="59.91%" id="mcps1.3.3.6.2.4.1.3"><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p7476163141415">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_row1647719318143"><td class="cellrowborder" valign="top" width="19.09%" headers="mcps1.3.3.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p19477153120144">result</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p144776317145">bool</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.3.3.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p847783161415">Deletion completed or not</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_row347712319149"><td class="cellrowborder" valign="top" width="19.09%" headers="mcps1.3.3.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p3477103118141">filepath</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p1647715317149">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.3.3.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p6477203151413">Residual file path</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_row9478531131419"><td class="cellrowborder" valign="top" width="19.09%" headers="mcps1.3.3.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p11477131111419">notes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p8477163114144">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.3.3.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p3477153131415">Notes</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p1247833111149">Example:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_screen2478153181413"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">pg_rm_residualfiles</span><span class="p">();</span>
|
|
<span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">filepath</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">notes</span><span class="w"> </span>
|
|
<span class="c1">--------+---------------------------+-------</span>
|
|
<span class="w"> </span><span class="n">t</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">pgrf_20200908160211441546</span><span class="w"> </span><span class="o">|</span><span class="w"> </span>
|
|
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
<div class="note" id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_note148053116141"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_ul648043161416"><li id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_li1480431161416">Residual files can be deleted only after verification using the pg_verify_residualfiles() function.</li><li id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_li248073161415">All verified files, regardless which database they are in, will be deleted.</li><li id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_li5480143110143">If all files recorded in the specified file have been deleted, the specified file will be removed and backed up in the <strong id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_b67209414694225">$PGDATA/pg_residualfile/backup</strong> directory.</li></ul>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_section17643104418145"><h4 class="sectiontitle">pgxc_rm_residualfiles()</h4><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p206412445140">Description: Unified CN query function of pgxc_rm_residualfiles. This function is a cluster-level function and is irrelevant to the current database. It runs on CNs.</p>
|
|
<p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p1664134491419">Parameter type: none</p>
|
|
<p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p66411144141413">Return type: record</p>
|
|
<p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p15641444151416">The following table describes return columns.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_table206431744141413" frame="border" border="1" rules="all"><caption><b>Table 3 </b>pgxc_rm_residualfiles () return fields</caption><thead align="left"><tr id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_row126411744141413"><th align="left" class="cellrowborder" valign="top" width="19.09%" id="mcps1.3.4.6.2.4.1.1"><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p16411744131415">Column</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.4.6.2.4.1.2"><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p19641744111420">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="59.91%" id="mcps1.3.4.6.2.4.1.3"><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p19641144417140">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_row264274418140"><td class="cellrowborder" valign="top" width="19.09%" headers="mcps1.3.4.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p126429449144">nodename</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.4.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p196421244151412">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.3.4.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p17642204431412">Node name</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_row1364294414140"><td class="cellrowborder" valign="top" width="19.09%" headers="mcps1.3.4.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p1164254419144">result</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.4.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p12642154431410">bool</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.3.4.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p10642244171412">Deletion completed or not</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_row364204417149"><td class="cellrowborder" valign="top" width="19.09%" headers="mcps1.3.4.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p116422444144">filepath</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.4.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p664212440142">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.3.4.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p5642184413143">Residual file path</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_row1264324415148"><td class="cellrowborder" valign="top" width="19.09%" headers="mcps1.3.4.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p19642174413146">notes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.4.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p1364364461415">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.3.4.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p46431144101415">Notes</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_p1564334414148">Example:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001460721144__en-us_topic_0000001495093645_screen1864324419149"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">pgxc_rm_residualfiles</span><span class="p">();</span>
|
|
<span class="w"> </span><span class="n">nodename</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">filepath</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">notes</span><span class="w"> </span>
|
|
<span class="c1">--------------+--------+---------------------------+-------</span>
|
|
<span class="w"> </span><span class="n">cn_5001</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">t</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">pgrf_20200910170129360401</span><span class="w"> </span><span class="o">|</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="n">dn_6001_6002</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">t</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">pgrf_20200908160211441546</span><span class="w"> </span><span class="o">|</span><span class="w"> </span>
|
|
<span class="p">(</span><span class="mi">2</span><span class="w"> </span><span class="k">rows</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0060.html">Residual File Management Functions</a></div>
|
|
</div>
|
|
</div>
|
|
|