Re: VM corruption on standby

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: Kirill Reshke <reshkekirill(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Melanie Plageman <melanieplageman(at)gmail(dot)com>
Subject: Re: VM corruption on standby
Date: 2025-09-03 06:47:28
Message-ID: EB4EF010-3246-4622-BC4C-2073AF3CDD2C@yandex-team.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 3 Sep 2025, at 11:37, Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:
>
> Could you, please, recheck?

That patch also adds CondVar sleep in critical section. That patch is how we understood that such sleep is dangerous.

Actual patch to deteact a problem is much simpler:
```
diff --git a/src/backend/storage/ipc/waiteventset.c
b/src/backend/storage/ipc/waiteventset.c
index 7c0e66900f9..e89e1d115cb 100644
--- a/src/backend/storage/ipc/waiteventset.c
+++ b/src/backend/storage/ipc/waiteventset.c
@@ -1044,6 +1044,7 @@ WaitEventSetWait(WaitEventSet *set, long timeout,
long cur_timeout = -1;

Assert(nevents > 0);
+ Assert(CritSectionCount == 0);

/*
* Initialize timeout if requested. We must record the current time so
```

Though it will fail in multixact test.

Best regards, Andrey Borodin.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2025-09-03 06:47:48 Should io_method=worker remain the default?
Previous Message Michael Paquier 2025-09-03 06:47:17 Re: Refactoring: Use soft error reporting for *_opt_error functions