pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: merryok <merryok@163.com>
To: adrian.klaver@aklaver.com
To: hjp-pgsql@hjp.at
Cc: pgsql-general@lists.postgresql.org
Subject: Re: equivalent thing of mtr in mysql
Date: Tue, 19 Jul 2022 11:03:50 +0800
Message-ID: <parcghlk5gg05gn2crkioq5m.1658199830937@email.android.com> (raw)
References: <52b03573-1e24-9cde-3bcb-41ecb60906ec@aklaver.com>

<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.klaver@aklaver.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/e...; 
<br>
&gt; &lt;<a href="https://dev.mysql.com/doc/refman/8.0/en/glossary.html">https://dev.mysql.com/doc/refman/8.0/e...
<br>
&gt; <a href="https://dev.mysql.com/blog-archive/mysql-8-0-new-lock-free-scalable-wal-design">https://dev.m... 
<br>
&gt; &lt;<a href="https://dev.mysql.com/blog-archive/mysql-8-0-new-lock-free-scalable-wal-design">https://dev.m...; 
<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...;
<br>

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

<br>

<br>
-- 
<br>
Adrian Klaver
<br>
<a href="mailto:adrian.klaver@aklaver.com">adrian.klaver@aklaver.com</a>
<br>
</p>
</blockquote></div>

view thread (8+ messages)  latest in thread

Message-ID: <parcghlk5gg05gn2crkioq5m.1658199830937@email.android.com>
Permalink:  ../parcghlk5gg05gn2crkioq5m.1658199830937@email.android.com/
Also on:    postgresql.org/message-id/parcghlk5gg05gn2crkioq5m.1658199830937@email.android.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: merryok@163.com, adrian.klaver@aklaver.com, hjp-pgsql@hjp.at
  Subject: Re: equivalent thing of mtr in mysql
  In-Reply-To: <parcghlk5gg05gn2crkioq5m.1658199830937@email.android.com>
  References: <52b03573-1e24-9cde-3bcb-41ecb60906ec@aklaver.com> <parcghlk5gg05gn2crkioq5m.1658199830937@email.android.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox