Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions
Дата
Msg-id CAFj8pRCzY8XKvkMBp0nO9H95KyvypQe5dEtt9s2Smis63+JhXQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions  (Joe Conway <mail@joeconway.com>)
Список pgsql-hackers


2015-11-05 19:56 GMT+01:00 Joe Conway <mail@joeconway.com>:
On 11/05/2015 10:48 AM, Pavel Stehule wrote:
>     S
>     t                    C
>     a<-------------<transaction>--------------->E
>     r    A      B     A      B      A           n
>     t <idle> <stmt> <idle> <stmt> <idle>        d
>     |--------======--------======---------------|
>
>     Currently we can set timeout and cancel for period B (<stmt>). I can see
>     based on this discussion that there are legitimate use cases for wanting
>     timeout and cancel for any of the periods A, B, or C.
>
>     I guess the question then becomes how we provide that coverage. I think
>     for coverage of timeout you need three individual timeout settings.
>     However for cancel, it would seem that pg_cancel_transaction would cover
>     all three cases.
>
>
> It can be difficult to set it properly, because you don't know how much
> statements (cycles of A.B) will be in transaction. Respective for
> setting C, I have to know the number of A,B and it isn't possible everytime.

But you might have a limit you want to enforce regardless of the size or
quantity of A & B periods. That's why it needs to be a separate timeout
IMHO. Let's say I never want a transaction to be around more than 60
minutes no matter what. But I also don't want idle in transaction to
ever exceed 30 seconds, and I don't expect individual statements to
exceed 10 minutes.

I am not sure due my wrong English if we are in agreement or not, I am sorry :/ - Any mentioned timeouts are useful and covers little bit different issues - and we need all.

Regards

Pavel
 

Joe

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development


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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions
Следующее
От: Robert Haas
Дата:
Сообщение: Re: extend pgbench expressions with functions