Re: bug reapper: Empty query_id in pg_stat_activity

Поиск
Список
Период
Сортировка
От Greg Sabino Mullane
Тема Re: bug reapper: Empty query_id in pg_stat_activity
Дата
Msg-id CAKAnmmJCuif76-RF5BLfmKrLS_8FQcivad2UbT9S-P3kGFyUmQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: bug reapper: Empty query_id in pg_stat_activity  (Srinath Reddy Sadipiralla <srinath2133@gmail.com>)
Ответы Re: bug reapper: Empty query_id in pg_stat_activity
Список pgsql-bugs
If I am reading the code in utils/activity/backend_status.c correctly, I not only see where it is happening (pgstat_report_activity), but why it is happening as well. There is definitely a race condition as we know what the query is before we have a chance to parse it and generate a query identifier for it. I'm not sure of the solution - we cannot exclude null query identifiers from the output, or callers will see the backend disappear briefly! We cannot avoid setting it to 0, as then we could have a query != query_id. We could store the query string somewhere and only reveal it once we have the identifier, but that's also tricky because we risk not setting it (and because we also set other things at the same time as the name, which would then be further disconnected). But maybe its the best option? I do agree this is a bug (and like Srinath, I can duplicate easily).

Anyway, my pre-caffeine two cents.

Cheers,
Greg

--
Enterprise Postgres Software Products & Tech Support

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