Re: REL_12_STABLE crashing with assertion failure in ExtractReplicaIdentity - Mailing list pgsql-hackers

From Tom Lane
Subject Re: REL_12_STABLE crashing with assertion failure in ExtractReplicaIdentity
Date
Msg-id 14590.1567457355@sss.pgh.pa.us
Whole thread Raw
In response to Re: REL_12_STABLE crashing with assertion failure inExtractReplicaIdentity  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> I agree that it ought to be more efficent - but also about as equally
> safe? I.e. if the previous code wasn't safe, the new code wouldn't be
> safe either? As in, we're "just" avoiding the assert, but not increasing
> safety?

Well, the point is that the old code risks performing a relcache load
without holding any lock on the relation.  In practice, given that
we do hold a lock on the parent table, it's probably safe ... but
it's at best bad practice.  It's not too hard to imagine future
optimizations that would allow this to result in a corrupt relcache entry.

I don't believe that there's any equivalent risk in the modified code.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: REL_12_STABLE crashing with assertion failure inExtractReplicaIdentity
Next
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] WAL logging problem in 9.4.3?