Re: Usage of epoch in txid_current
От | Jeff Janes |
---|---|
Тема | Re: Usage of epoch in txid_current |
Дата | |
Msg-id | CAMkU=1xLb7105EaAEpSyCs7RbHPZm_nZw7qMkvJp3h4_FeZrZA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Usage of epoch in txid_current (Thomas Munro <thomas.munro@gmail.com>) |
Ответы |
Re: Usage of epoch in txid_current
|
Список | pgsql-hackers |
On Thu, Mar 28, 2019 at 1:30 AM Thomas Munro <thomas.munro@gmail.com> wrote:
On Thu, Mar 28, 2019 at 1:48 AM Heikki Linnakangas <hlinnaka@iki.fi> wrote:
> Once we have the FullTransactionId type and basic macros in place, I'm
> sure we could tidy up a bunch of code by using them.
Thanks for the reviews! Pushed.
I think that this might be broken.
We have this change:
@@ -73,7 +75,8 @@ GetNewTransactionId(bool isSubXact)
LWLockAcquire(XidGenLock, LW_EXCLUSIVE);
- xid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
+ full_xid = ShmemVariableCache->nextFullXid;
+ xid = XidFromFullTransactionId(full_xid);
But then later on in an little-used code path around line 164:
/* Re-acquire lock and start over */
LWLockAcquire(XidGenLock, LW_EXCLUSIVE);
xid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
full_xid does not get updated, but then later on full_xid gets returned in lieu of xid.
Is there a reason that this is OK?
Cheers,
Jeff
В списке pgsql-hackers по дате отправления: