On 2022-Apr-13, Amit Kapila wrote:
> Thanks, this will work and fix the issue. I think this looks better
> than the current code,
Thanks for looking! Pushed.
> however, I am not sure if the handling for the
> concurrently dropped tables is better (both get_rel_relkind() and
> get_rel_name() can fail due to those reasons). I understand this won't
> fail because of the protection you have in the patch,
Well, the point is that these routines return NULL if the relation
cannot be found in the cache, so just doing "continue" (without raising
any error) if any of those happens is sufficient for correct behavior.
BTW I just noticed that AlterPublicationOptions acquires only
ShareAccessLock on the publication object. I think this is too lax ...
what if two of them run concurrently? (say to specify different
published actions) Do they overwrite the other's update? I think it'd
be better to acquire ShareUpdateExclusive to ensure only one is running
at a time.
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"This is a foot just waiting to be shot" (Andrew Dunstan)