Re: standby recovery fails (tablespace related) (tentative patch and discussion)

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: dilipbalaut(at)gmail(dot)com, robertmhaas(at)gmail(dot)com, michael(at)paquier(dot)xyz, rjuju123(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: standby recovery fails (tablespace related) (tentative patch and discussion)
Date: 2022-07-14 21:47:40
Message-ID: 20220714214740.drhmvdx2aseqgvvb@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here's a couple of fixups. 0001 is the same as before. In 0002 I think
CheckTablespaceDirectory ends up easier to read if we split out the test
for validity of the link. Looking at that again, I think we don't need
to piggyback on ignore_invalid_pages, which is already a stretch, so
let's not -- instead we can use allow_in_place_tablespaces if users need
a workaround. So that's 0003 (this bit needs more than zero docs,
however.)

0004 is straightforward: let's check for bad directories before logging
about consistent state.

After all this, I'm not sure what to think of dbase_redo. At line 3102,
is the directory supposed to exist or not? I'm confused as to what is
the expected state at that point. I rewrote this, but now I think my
rewrite continues to be confusing, so I'll have to think more about it.

Another aspect are the tests. Robert described a scenario where the
previously committed version of this patch created trouble. Do we have
a test case to cover that problematic case? I think we should strive to
cover it, if possible.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"The eagle never lost so much time, as
when he submitted to learn of the crow." (William Blake)

Attachment Content-Type Size
v25-0001-Fix-replay-of-create-database-records-on-standby.patch text/x-diff 18.3 KB
v25-0002-split-is_path_tslink-as-a-new-routine.patch text/x-diff 3.5 KB
v25-0003-Don-t-rely-on-ignore_invalid_pages-at-all.patch text/x-diff 1.5 KB
v25-0004-do-CheckTablespaceDirectory-first.patch text/x-diff 1.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2022-07-14 21:52:25 Re: pg_parameter_aclcheck() and trusted extensions
Previous Message Bruce Momjian 2022-07-14 21:41:51 Re: doc: Clarify Routines and Extension Membership