isolationtester: add session name to application name

Поиск
Список
Период
Сортировка
От Andres Freund
Тема isolationtester: add session name to application name
Дата
Msg-id 20211211012052.2blmzcmxnxqawd2z@alap3.anarazel.de
обсуждение исходный текст
Ответы Re: isolationtester: add session name to application name  (Andrew Dunstan <andrew@dunslane.net>)
Re: isolationtester: add session name to application name  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Hi,

When writing / debugging an isolation test it's sometimes useful to see which
session holds what lock etc. I find it kind of painful to map pg_stat_activity
/ pg_locks / log output to the isolationtester spec. Sometimes its easy enough
to infer identity based on a statement, but far from all the time.

I found it very helpful to have each session's setup step do something like
  SET application_name = 'isolation/prune-recently-dead/vac';

These days isolationtester.c already prefixes log output with the session
name. How about doing the same for application_name? It's a *tad* more
complicated than I'd like because isolationtester.c currently doesn't know the
name of the test its executing.

The attached patch executes
  SELECT set_config('application_name', current_setting('application_name') || '/' || $1, false);
when establishing connections to deal with that.

As attached this appends "control connection" for the control connection, but
perhaps we should just not append anything for that?

Greetings,

Andres Freund

Вложения

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

Предыдущее
От: Paul Jungwirth
Дата:
Сообщение: range_agg with multirange inputs
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: PATCH: generate fractional cheapest paths in generate_orderedappend_path