Re: Arbitary file size limit in twophase.c

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Arbitary file size limit in twophase.c
Дата
Msg-id 25025.1210689263@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Arbitary file size limit in twophase.c  (Gavin Sherry <swm@alcove.com.au>)
Ответы Re: Arbitary file size limit in twophase.c  (Gavin Sherry <swm@alcove.com.au>)
Re: Arbitary file size limit in twophase.c  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Список pgsql-hackers
Gavin Sherry <swm@alcove.com.au> writes:
> There's an apparently arbitary limit of 10,000,000 bytes in twophase.c
> on the size of a two phase commit file. I can't see why this limit
> exists.

The comment seems perfectly clear about why the limit exists:
    * Check file length.  We can determine a lower bound pretty easily. We    * set an upper bound mainly to avoid
palloc()failure on a corrupt file.
 

although certainly the specific value has been picked out of the air.

Perhaps it'd be better to use malloc() than palloc(), so that we'd not
lose control on out-of-memory, and then deem the file "too big" only
if we couldn't malloc the space.

Or we could try to fix things so that the file doesn't have to be all in
memory, but that seems pretty invasive.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: psql wrapped format default for backslash-d commands
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: psql wrapped format default for backslash-d commands