Hi,
In gtm_txn.h we have this macro:
#define GTM_CountOpenTransactions()
(gtm_list_length(GTMTransactions.gt_open_transactions))
If this macro is called without taking a lock on gt_TransArrayLock
then it can return spurious results. Currently it's not used anywhere
so we are safe. I thought of adding a READ lock to gt_TransArrayLock
inside the macro itself, but it's possible that the caller is already
holding the lock. So I thought it best to add a comment above this
macro.
Or we can even remove this macro to be on the safe side.
Regards,
Nikhils
--
StormDB - http://www.stormdb.com
The Database Cloud
Postgres-XC Support and Service
From: Michael P. <mic...@gm...> - 2013-02-21 23:08:16
Thanks. Applied.
On Fri, Feb 22, 2013 at 12:41 AM, Nikhil Sontakke <ni...@st...>wrote:
> Or we can even remove this macro to be on the safe side.
>
Not sure, it looks pretty useful to do that as a macro for transaction
count control.
--
Michael
From: Koichi S. <koi...@gm...> - 2013-02-22 03:13:00
Changing the macro into a function does not solve the issue. It does
not eliminate the need to acquire the lock. Adding comment to the
macro definition is reasonable compromise.
Regards;
----------
Koichi Suzuki
2013/2/22 Michael Paquier <mic...@gm...>:
> Thanks. Applied.
>
> On Fri, Feb 22, 2013 at 12:41 AM, Nikhil Sontakke <ni...@st...>
> wrote:
>>
>> Or we can even remove this macro to be on the safe side.
>
> Not sure, it looks pretty useful to do that as a macro for transaction count
> control.
> --
> Michael
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> Postgres-xc-developers mailing list
> Pos...@li...
> https://lists.sourceforge.net/lists/listinfo/postgres-xc-developers
>