pgsql: Fix incorrect timeout handling during initial authentication tra

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix incorrect timeout handling during initial authentication tra
Дата
Msg-id E1QsMA8-0003Ci-Iy@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix incorrect timeout handling during initial authentication transaction.

The statement start timestamp was not set before initiating the transaction
that is used to look up client authentication information in pg_authid.
In consequence, enable_sig_alarm computed a wrong value (far in the past)
for statement_fin_time.  That didn't have any immediate effect, because the
timeout alarm was set without reference to statement_fin_time; but if we
subsequently blocked on a lock for a short time, CheckStatementTimeout
would consult the bogus value when we cancelled the lock timeout wait,
and then conclude we'd timed out, leading to immediate failure of the
connection attempt.  Thus an innocent "vacuum full pg_authid" would cause
failures of concurrent connection attempts.  Noted while testing other,
more serious consequences of vacuum full on system catalogs.

We should set the statement timestamp before StartTransactionCommand(),
so that the transaction start timestamp is also valid.  I'm not sure if
there are any non-cosmetic effects of it not being valid, but the xact
timestamp is at least sent to the statistics machinery.

Back-patch to 9.0.  Before that, the client authentication timeout was done
outside any transaction and did not depend on this state to be valid.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/592b615d71caac8a3504276a805a6fd024c40041

Modified Files
--------------
src/backend/utils/init/postinit.c |    2 ++
1 files changed, 2 insertions(+), 0 deletions(-)


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: pgsql: Make USECS_PER_* timestamp macros visible even when we are not u
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix incorrect timeout handling during initial authentication tra