Обсуждение: BUG #16667: COMMIT AND CHAIN does not udpates database metrics ie. xact_commit

Поиск
Список
Период
Сортировка

BUG #16667: COMMIT AND CHAIN does not udpates database metrics ie. xact_commit

От
PG Bug reporting form
Дата:
The following bug has been logged on the website:

Bug reference:      16667
Logged by:          COMMIT AND CHAIN - pg_stat_database metrics are not updated
Email address:      axgrech@gmail.com
PostgreSQL version: 12.4
Operating system:   RHEL 7.8
Description:

We have an application that uses a new feature COMMIT AND CHAIN, the
application works generaly OK, but we have noticed that the pg_stat_database
(xact_commit/xact_rollback) are not updated, as they are if we used
BEGIN/COMMIT/BEGIN.
according to the documentation COMMIT AND CHAIN commits current transaction
and starts a new transaction with the same characteristic as current, what
we believe should impact number of transactions reported by the database.

There is some change when we stop our application (the app is server type,
that keeps database connection open all the time), however pg_stat_number
numbers does not matches (ok, i have not checked it with details, but it
looks it does not).

As the pg_stat_database metrics (i am not sure about other metrics) are not
updated, the monitoring tools does not report any activity on the database.


Re: BUG #16667: COMMIT AND CHAIN does not udpates database metrics ie. xact_commit

От
Tom Lane
Дата:
PG Bug reporting form <noreply@postgresql.org> writes:
> We have an application that uses a new feature COMMIT AND CHAIN, the
> application works generaly OK, but we have noticed that the pg_stat_database
> (xact_commit/xact_rollback) are not updated, as they are if we used
> BEGIN/COMMIT/BEGIN.

I can't reproduce that here.  Indeed, in a quick check I'd say the
opposite: it looks like xact_commit advances twice where I'd only
have expected it to advance once.

            regards, tom lane



Re: BUG #16667: COMMIT AND CHAIN does not udpates database metrics ie. xact_commit

От
adam grech
Дата:
The test case code uses ANSI C and libpq.
I will check does ECPG behaves the same way.

Adam

W dniu pon., 12.10.2020 o 17:21 Tom Lane <tgl@sss.pgh.pa.us> napisał(a):
PG Bug reporting form <noreply@postgresql.org> writes:
> We have an application that uses a new feature COMMIT AND CHAIN, the
> application works generaly OK, but we have noticed that the pg_stat_database
> (xact_commit/xact_rollback) are not updated, as they are if we used
> BEGIN/COMMIT/BEGIN.

I can't reproduce that here.  Indeed, in a quick check I'd say the
opposite: it looks like xact_commit advances twice where I'd only
have expected it to advance once.

                        regards, tom lane