Re: V3 protocol gets out of sync on messages that cause allocation

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: V3 protocol gets out of sync on messages that cause allocation
Дата
Msg-id 4176D646.9050803@opencloud.com
обсуждение исходный текст
Ответ на Re: V3 protocol gets out of sync on messages that cause allocation failures  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> I wrote:
> 
>>Yeah.  The intent of the protocol design was that the recipient could
>>skip over the correct number of bytes even if it didn't have room to
>>buffer them, but the memory allocation mechanism in the backend makes
>>it difficult to actually do that.  Now that we have PG_TRY, though,
>>it might not be out of reach to do it right.
> 
> 
> And indeed it wasn't.  Patch committed.

Thanks!

Re your commit comment:

> I'm a bit dubious that this is a real problem, since the client likely
> doesn't have any more space available than the server, but it's not hard
> to make it behave according to the protocol intention.

It's quite possible that the client isn't keeping the whole parameter in 
memory. For example, JDBC has a method that allows a streamable 
parameter (with prespecified length) to be set, and the stream contents 
could be coming from disk or computed on demand. That is actually where 
I came across the problem in the first place.

-O


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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: Why frequently updated tables are an issue
Следующее
От: Philip Warner
Дата:
Сообщение: Re: Using ALTER TABLESPACE in pg_dump