Re: 32TB relation size make mdnblocks overflow - Mailing list pgsql-hackers

From Julien Rouhaud
Subject Re: 32TB relation size make mdnblocks overflow
Date
Msg-id 20220118072510.uimhupioyhr7tc77@jrouhaud
Whole thread Raw
In response to 32TB relation size make mdnblocks overflow  ("陈佳昕(步真)" <buzhen.cjx@alibaba-inc.com>)
Responses Re: 32TB relation size make mdnblocks overflow
List pgsql-hackers
Hi,

On Tue, Jan 18, 2022 at 02:21:14PM +0800, 陈佳昕(步真) wrote:
> 
> We know that PostgreSQL doesn't support a single relation size over 32TB,
> limited by the MaxBlockNumber. But if we just 'insert into' one relation over
> 32TB, it will get an error message 'unexpected data beyond EOF in block 0 of
> relation' in ReadBuffer_common. The '0 block' is from mdnblocks function
> where the segment number is over 256 and make segno * RELSEG_SIZE over
> uint32's max value. So is it necessary to make the error message more
> readable like 'The relation size is over max value ...' and elog in
> mdnblocks?

I didn't try it but this is supposed to be caught by mdextend():

    /*
     * If a relation manages to grow to 2^32-1 blocks, refuse to extend it any
     * more --- we mustn't create a block whose number actually is
     * InvalidBlockNumber.  (Note that this failure should be unreachable
     * because of upstream checks in bufmgr.c.)
     */
    if (blocknum == InvalidBlockNumber)
        ereport(ERROR,
                (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
                 errmsg("cannot extend file \"%s\" beyond %u blocks",
                        relpath(reln->smgr_rnode, forknum),
                        InvalidBlockNumber)));


Didn't you hit this?



pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)
Next
From: Simon Riggs
Date:
Subject: Re: generic plans and "initial" pruning