Re: hash join error improvement (old)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: hash join error improvement (old)
Дата
Msg-id 17635.1590504211@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: hash join error improvement (old)  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: hash join error improvement (old)  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: hash join error improvement (old)  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Hmm, right -- I was extending the partial read case to apply to a
> partial write, and we deal with those very differently.  I changed the
> write case to use our standard approach.

Actually ... looking more closely, this proposed change in
ExecHashJoinSaveTuple flat out doesn't work, because it assumes that
BufFileWrite reports errors the same way as write(), which is not the
case.  In particular, written < 0 can't happen; moreover, you've
removed detection of a short write as opposed to a completely failed
write.

Digging further down, it looks like BufFileWrite calls BufFileDumpBuffer
which calls FileWrite which takes pains to set errno correctly after a
short write --- so other than the lack of commentary about these
functions' error-reporting API, I don't think there's any actual bug here.
Are you sure you correctly identified the source of the bogus error
report?

Similarly, I'm afraid you introduced rather than removed problems
in ExecHashJoinGetSavedTuple.  BufFileRead doesn't use negative
return values either.

            regards, tom lane



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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Default gucs for EXPLAIN
Следующее
От: Guillaume Lelarge
Дата:
Сообщение: Re: Default gucs for EXPLAIN