Re: The same 2PC data maybe recovered twice

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: The same 2PC data maybe recovered twice
Дата
Msg-id ZLT0+RtNqRNqXKUz@paquier.xyz
обсуждение исходный текст
Ответ на Re: The same 2PC data maybe recovered twice  ("suyu.cmj" <mengjuan.cmj@alibaba-inc.com>)
Ответы Re: The same 2PC data maybe recovered twice  ("suyu.cmj" <mengjuan.cmj@alibaba-inc.com>)
Список pgsql-bugs
On Mon, Jul 17, 2023 at 02:26:56PM +0800, suyu.cmj wrote:
> Yes, the method you proposed is simpler and more
> efficient. Following your idea, I have modified the corresponding
> patch, hope you can review it when you have time.

I'll double-check that tomorrow, but yes, that's basically what I had
in mind.  Thanks for the patch!

+   char        path[MAXPGPATH];
+   struct stat stat_buf;
These two variables can be declared in the code block added by the
patch where start_lsn is valid.

+    ereport(FATAL,
+            (errmsg("found unexpected duplicate two-phase
transaction:%u in pg_twophase, check for data correctness.",
+                    hdr->xid)));

The last part of this sentence has no need to be IMO, because it is
misleading when building without assertions.  How about a single
FATAL/WARNING like that:
- errmsg: "could not recover two-phase state file for transaction %u"
- errdetail: "Two-phase state file has been found in WAL record %X/%X
but this transaction has already been restored from disk."

Then a WARNING simply means that we've skipped the record entirely.
--
Michael

Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Query returns error "there is no parameter $1" but server logs that there are two parameters supplied
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: BUG #18025: Probably we need to change behaviour of the checkpoint failures in PG