Re: RecoveryInProgress() has critical side effects - Mailing list pgsql-hackers

From Robert Haas
Subject Re: RecoveryInProgress() has critical side effects
Date
Msg-id CA+TgmobKiqR66XV4zB5Kb=wJ3PKN4J_FTvkGxqOET20T_vB8hg@mail.gmail.com
Whole thread Raw
In response to Re: RecoveryInProgress() has critical side effects  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: RecoveryInProgress() has critical side effects  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
On Sat, Nov 20, 2021 at 3:22 PM Heikki Linnakangas <hlinnaka@iki.fi> wrote:
> But here's yet another idea: We could initialize RedoRecPtr and
> doPageWrites in InitXLogInsert(). It would seem like a pretty natural
> place for it.

I considered that, but it seemed like an abstraction violation to me,
because that code is part of xloginsert.c, which is mostly concerned
with assembly of write-ahead log records, not the associated
shared-memory state. Also, I don't think there's any guarantee that
the state in shared memory is initialized at the time we call that
function, so we might just be copying uninitialized memory into other
uninitialized memory.

> PS. typo in patch v2: s/prepard/prepared/

Thanks, fixed.

-- 
Robert Haas
EDB: http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd
Next
From: Peter Eisentraut
Date:
Subject: Re: Non-decimal integer literals