From: | Andres Freund <andres(at)anarazel(dot)de> |
---|---|
To: | Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> |
Cc: | sawada(dot)mshk(at)gmail(dot)com, amit(dot)kapila16(at)gmail(dot)com, michael(at)paquier(dot)xyz, jkatz(at)postgresql(dot)org, jcasanov(at)systemguards(dot)com(dot)ec, pgsql-hackers(at)postgresql(dot)org, john(dot)naylor(at)enterprisedb(dot)com |
Subject: | Re: START_REPLICATION SLOT causing a crash in an assert build |
Date: | 2022-10-07 19:00:56 |
Message-ID: | 20221007190056.qkavkwppks7topew@awork3.anarazel.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
On 2022-10-07 15:30:43 +0900, Kyotaro Horiguchi wrote:
> At Fri, 7 Oct 2022 12:14:40 +0900, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote in
> > > What about if we go the other direction - simply remove the name from the
> > > stats entry at all. I don't actually think we need it anymore. Unless I am
> > > missing something right now - entirely possible! - the danger that
> > > pgstat_acquire_replslot() mentions doesn't actually exist [anymore]. After a
> > > crash we throw away the old stats data and if a slot is dropped while shut
> > > down, we'll not load the slot data at startup.
>
> The key point of this is this:
>
> + * XXX: I think there cannot actually be data from an older slot
> + * here. After a crash we throw away the old stats data and if a slot is
> + * dropped while shut down, we'll not load the slot data at startup.
>
> I think this is true. Assuming that we don't recreate or rename
> objects that have stats after writing out stats, we won't have stats
> for a different object with the same name.
Thanks for thinking through this!
> If we can rely on that fact, the existing check in pgstat_acquire_replslot()
> becomes useless. Thus we don't need to store object name in stats entry. I
> agree to that.
I don't agree with this aspect. I think it's better to ensure that the stats
object exists when acquiring a slot, rather than later, when reporting. It's a
lot simpler to think through the lock nesting etc that way.
I'd also eventually like to remove the stats that are currently kept
separately in ReorderBuffer, and that will be easier/cheaper if we can rely on
the stats objects to have already been created.
Greetings,
Andres Freund
From | Date | Subject | |
---|---|---|---|
Next Message | Israel Barth Rubio | 2022-10-07 19:09:28 | Re: Add support for DEFAULT specification in COPY FROM |
Previous Message | Ranier Vilela | 2022-10-07 18:45:34 | Re: Avoid mix char with bool type in comparisons |