pgsql: Fix snapshot leak if lo_open called on non-existent object.

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Fix snapshot leak if lo_open called on non-existent object.
Дата
Msg-id E1VQaMX-00023w-AL@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix snapshot leak if lo_open called on non-existent object.

lo_open registers the currently active snapshot, and checks if the
large object exists after that. Normally, snapshots registered by lo_open
are unregistered at end of transaction when the lo descriptor is closed, but
if we error out before the lo descriptor is added to the list of open
descriptors, it is leaked. Fix by moving the snapshot registration to after
checking if the large object exists.

Reported by Pavel Stehule. Backpatch to 8.4. The snapshot registration
system was introduced in 8.4, so prior versions are not affected (and not
supported, anyway).

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/fc7a38f3250d3678fb2f64d8b6a18cd380f1dd6a

Modified Files
--------------
src/backend/storage/large_object/inv_api.c |   44 ++++++++++++++++------------
1 file changed, 26 insertions(+), 18 deletions(-)


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: pgsql: Revert "Backpatch pgxs vpath build and installation fixes."
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix snapshot leak if lo_open called on non-existent object.