From: Andres Freund Date: Sun, 21 May 2023 16:48:37 +0000 (-0700) Subject: Remove over-eager assertion in ExtendBufferedRelTo() X-Git-Tag: REL_16_BETA1~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eabb22525efc40ce0d83580584094a0248ac0682;p=thirdparty%2Fpostgresql.git Remove over-eager assertion in ExtendBufferedRelTo() The assertion checked that the size of the relation is not "too large" - but the code is explicitly dealing with the possibility of another backend extending the relation concurrently. In that case the new relation size could be bigger than what the current backend needs, wrongly triggering an assertion failure. Unfortunately it is hard to write a reliable and affordable regression tests for this, as a lot of concurrency is needed to encounter the bug. Introduced in 31966b151e6a. Reported-by: Melanie Plageman --- diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index aafec4a09d5..3c59bbd04ea 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -953,7 +953,6 @@ ExtendBufferedRelTo(ExtendBufferedWhat eb, buffers, &extended_by); current_size = first_block + extended_by; - Assert(current_size <= extend_to); Assert(num_pages != 0 || current_size >= extend_to); for (int i = 0; i < extended_by; i++)