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've read the doc, and it doesn't help too much.<br>
</div><div dir="ltr">Finally I've found START_CRIT_SECTION and END_CRIT_SECTION. It'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 > 0) isn't satisfied (CritSectionCount need't be protected ?), PG server will panic and exit ? If so, what'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 <adrian.klaver@aklaver.com>,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>
> I'm sorry, first time to post a thread. mtr is short for mini-transaction.
<br>
> About mtr in mysql, we can refer to
<br>
> <a href="https://dev.mysql.com/doc/refman/8.0/en/glossary.html">https://dev.mysql.com/doc/refman/8.0/e...;
<br>
> <<a href="https://dev.mysql.com/doc/refman/8.0/en/glossary.html">https://dev.mysql.com/doc/refman/8.0/e...
<br>
> <a href="https://dev.mysql.com/blog-archive/mysql-8-0-new-lock-free-scalable-wal-design">https://dev.m...
<br>
> <<a href="https://dev.mysql.com/blog-archive/mysql-8-0-new-lock-free-scalable-wal-design">https://dev.m...;
<br>
>
<br>
>
<br>
>
<br>
> So an insert in mysql, wrapped in a user transaction, may result in
<br>
> multiple mini-transactions, one is responsible for writing redo for
<br>
> undo, the other one for writing redo for clustered index/secondary
<br>
> index, and so on. Each mtr may modify multiple pages, whose redo logs
<br>
> are guaranteed by mtr to be written into disk or none of them are written.
<br>
>
<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>
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