Re: equivalent thing of mtr in mysql

From: merryok <merryok(at)163(dot)com>
To: adrian(dot)klaver(at)aklaver(dot)com, hjp-pgsql(at)hjp(dot)at
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: equivalent thing of mtr in mysql
Date: 2022-07-19 03:03:50
Message-ID: parcghlk5gg05gn2crkioq5m.1658199830937@email.android.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<div dir="ltr">I&#39;ve read the doc, and it doesn&#39;t help too much.<br>
</div><div dir="ltr">Finally I&#39;ve found START_CRIT_SECTION and END_CRIT_SECTION. It&#39;s like mtr.start(), mtr.commit() in mysql. May I ask why many places are wrapped into START_CRIT_SECTION/END_CRIT_SECTION during a single dml operation ?<br>
</div><div dir="ltr"><br>
</div><div dir="ltr">And if Assert(CritSectionCount &gt; 0) isn&#39;t satisfied (CritSectionCount need&#39;t be protected ?), PG server will panic and exit ? If so, what&#39;s the probability of that ?<br>
</div><div dir="ltr"><br>
</div><div dir="ltr"><br>
</div><div dir="ltr"><br>
</div><div dir="ltr"><br>
</div><div dir="ltr"><br>
</div><div class="wps_signature">发自我的小米手机</div><div class="wps_quotion">在 Adrian Klaver &lt;adrian(dot)klaver(at)aklaver(dot)com&gt;,2022年7月16日 23:30写道:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p></p><p dir="ltr">On 7/15/22 18:31, merryok wrote:
<br>
&gt; I&#39;m sorry, first time to post a thread. mtr is short for mini-transaction.
<br>
&gt; About mtr in mysql, we can refer to
<br>
&gt; <a href="https://dev.mysql.com/doc/refman/8.0/en/glossary.html">https://dev.mysql.com/doc/refman/8.0/en/glossary.html</a>
<br>
&gt; &lt;<a href="https://dev.mysql.com/doc/refman/8.0/en/glossary.html">https://dev.mysql.com/doc/refman/8.0/en/glossary.html</a>&gt; or
<br>
&gt; <a href="https://dev.mysql.com/blog-archive/mysql-8-0-new-lock-free-scalable-wal-design">https://dev.mysql.com/blog-archive/mysql-8-0-new-lock-free-scalable-wal-design</a>/
<br>
&gt; &lt;<a href="https://dev.mysql.com/blog-archive/mysql-8-0-new-lock-free-scalable-wal-design">https://dev.mysql.com/blog-archive/mysql-8-0-new-lock-free-scalable-wal-design</a>/&gt;
<br>
&gt;
<br>
&gt;
<br>
&gt;
<br>
&gt; So an insert in mysql,  wrapped in a user transaction, may result in
<br>
&gt; multiple mini-transactions, one is responsible for writing redo for
<br>
&gt; undo, the other one for writing redo for clustered index/secondary
<br>
&gt; index, and so on. Each mtr may modify multiple pages,  whose redo logs
<br>
&gt; are guaranteed by mtr to be written into disk or none of them are written.
<br>
&gt;
<br>

<br>
Read this:
<br>

<br>
<a href="https://www.postgresql.org/docs/current/wal.html">https://www.postgresql.org/docs/current/wal.html</a>
<br>

<br>
and see if it answers your questions.
<br>

<br>

<br>
--
<br>
Adrian Klaver
<br>
<a href="mailto:adrian(dot)klaver(at)aklaver(dot)com">adrian(dot)klaver(at)aklaver(dot)com</a>
<br>
</p>
</blockquote></div>

Attachment Content-Type Size
unknown_filename text/html 2.6 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2022-07-19 03:10:14 Getting the table ID
Previous Message Thomas Munro 2022-07-19 01:09:12 Re: [PATCH] Introduce array_shuffle() and array_sample()