[PATCH] Fix alter subscription concurrency errors - Mailing list pgsql-hackers

From Jelte Fennema
Subject [PATCH] Fix alter subscription concurrency errors
Date
Msg-id HE1PR8303MB0075BF78AF1BE904050DA16BF7729@HE1PR8303MB0075.EURPRD83.prod.outlook.com
Whole thread Raw
Responses Re: [PATCH] Fix alter subscription concurrency errors
List pgsql-hackers
Without this patch concurrent ALTER/DROP SUBSCRIPTION statements for
the same subscription could result in one of these statements returning the
following error:

ERROR:  XX000: tuple concurrently updated

This patch fixes that by re-fetching the tuple after acquiring the lock on the
subscription. The included isolation test fails most of its permutations
without this patch, with the error shown above.

The loop to re-fetch the tuple is heavily based on the code from dbcommands.c
Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: pg_basebackup: add test about zstd compress option
Next
From: Tom Lane
Date:
Subject: Re: pg_regress: lookup shellprog in $PATH