Re: Arbitary file size limit in twophase.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
Cc: "Gavin Sherry" <swm(at)alcove(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Arbitary file size limit in twophase.c
Date: 2008-05-13 16:24:40
Message-ID: 27180.1210695880@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Heikki Linnakangas" <heikki(at)enterprisedb(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-05-13 16:30:47 Re: psql wrapped format default for backslash-d commands
Previous Message Heikki Linnakangas 2008-05-13 16:18:25 Re: Arbitary file size limit in twophase.c