Re: Arbitary file size limit in twophase.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Arbitary file size limit in twophase.c
Date
Msg-id 27180.1210695880@sss.pgh.pa.us
Whole thread Raw
In response to Re: Arbitary file size limit in twophase.c  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Responses Re: Arbitary file size limit in twophase.c  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
List pgsql-hackers
"Heikki Linnakangas" <heikki@enterprisedb.com> writes:
> If we're going to check for file length, we should definitely check the 
> file length when we write it, so that we fail at PREPARE time, and not 
> at COMMIT time.

I think this is mere self-delusion, unfortunately.  You can never be
certain at prepare time that a large alloc will succeed sometime later
in a different process.

Gavin's complaint is essentially that a randomly chosen hard limit is
bad, and I agree with that.  Choosing a larger hard limit doesn't make
it less random.

It might be worth checking at prepare that the file size doesn't exceed
MaxAllocSize, but any smaller limit strikes me as (a) unnecessarily
restrictive and (b) not actually creating any useful guarantee.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Heikki Linnakangas"
Date:
Subject: Re: Arbitary file size limit in twophase.c
Next
From: Tom Lane
Date:
Subject: Re: psql wrapped format default for backslash-d commands