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'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(dot)klaver(at)aklaver(dot)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/en/glossary.html</a>
<br>
> <<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>> or
<br>
> <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>
> <<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>
>
<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.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 |
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() |