Re: Query on pg_stat_activity table got stuck
От | Tom Lane |
---|---|
Тема | Re: Query on pg_stat_activity table got stuck |
Дата | |
Msg-id | 30687.1557432052@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Query on pg_stat_activity table got stuck (Jeremy Schneider <schnjere@amazon.com>) |
Ответы |
Re: Query on pg_stat_activity table got stuck
Re: Query on pg_stat_activity table got stuck |
Список | pgsql-admin |
Jeremy Schneider <schnjere@amazon.com> writes: > Seems to me that at a minimum, this loop shouldn't go on forever. Even > having an arbitrary, crazy high, hard-coded number of attempts before > failure (like a million) would be better than spinning on the CPU > forever - which is what we are seeing. I don't think it's the readers' fault. The problem is that the writer is violating the protocol. If we put an upper limit on the number of spin cycles on the reader side, we'll just be creating a new failure mode when a writer gets swapped out at the wrong moment. IMO we need to (a) get the failure-prone code out of the critical section, and then (b) fix the pgstat_increment_changecount macros so that the critical sections around these shmem changes really are critical sections (ie bump CritSectionCount). That way, if somebody makes the same mistake again, at least there'll be a pretty obvious failure rather than a lot of stuck readers. regards, tom lane
В списке pgsql-admin по дате отправления: