pgsql: Prevent race condition while reading relmapper file.

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Prevent race condition while reading relmapper file.
Дата
Msg-id E1lwK4R-0008TU-Eu@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Prevent race condition while reading relmapper file.

Contrary to the comment here, POSIX does not guarantee atomicity of a
read(), if another process calls write() concurrently. Or at least Linux
does not. Add locking to load_relmap_file() to avoid the race condition.

Fixes bug #17064. Thanks to Alexander Lakhin for the report and test case.

Backpatch-through: 9.6, all supported versions.
Discussion: https://www.postgresql.org/message-id/17064-bb0d7904ef72add3@postgresql.org

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/85ae8ccb2fb330785c6503316635dc7256cbe495

Modified Files
--------------
src/backend/utils/cache/relmapper.c | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)


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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: pgsql: Doc: Update logical replication message formats.
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Another fix to relmapper race condition.