RE: [HACKERS] Re: Strangeness in xid allocation / snapshot setup

2001-07-12 Thread Mikheev, Vadim
> >> Given this, I'm wondering why we bother with having a separate > >> XidGenLock spinlock at all. Why not eliminate it and use SInval > >> spinlock to lock GetNewTransactionId and ReadNewTransactionId? > > > Reading all MyProc in GetSnashot may take long time - why disallow > > new Tx to begi

Re: [HACKERS] Re: Strangeness in xid allocation / snapshot setup

2001-07-12 Thread Tom Lane
"Mikheev, Vadim" <[EMAIL PROTECTED]> writes: > Isn't spinlock just a few ASM instructions?... on most platforms... If we change over to something that supports read vs write locking, it's probably going to be rather more than that ... right now, I'm pretty dissatisfied with the performance of our

RE: [HACKERS] Re: Strangeness in xid allocation / snapshot setup

2001-07-12 Thread Mikheev, Vadim
> > Isn't spinlock just a few ASM instructions?... on most platforms... > > If we change over to something that supports read vs write locking, > it's probably going to be rather more than that ... right now, I'm > pretty dissatisfied with the performance of our spinlocks under load. We shouldn'

Re: [HACKERS] Re: Strangeness in xid allocation / snapshot setup

2001-07-12 Thread Tom Lane
"Mikheev, Vadim" <[EMAIL PROTECTED]> writes: >> Given this, I'm wondering why we bother with having a separate >> XidGenLock spinlock at all. Why not eliminate it and use SInval >> spinlock to lock GetNewTransactionId and ReadNewTransactionId? > Reading all MyProc in GetSnashot may take long tim

RE: [HACKERS] Re: Strangeness in xid allocation / snapshot setup

2001-07-12 Thread Mikheev, Vadim
> Oh, now I get it: the point is to prevent Tx Old from exiting the set > of "still running" xacts as seen by Tx S. Okay, it makes sense. > I'll try to add some documentation to explain it. TIA! I had no time from '99 -:) > Given this, I'm wondering why we bother with having a separate > XidGen

Re: [HACKERS] Re: Strangeness in xid allocation / snapshot setup

2001-07-12 Thread Tom Lane
"Mikheev, Vadim" <[EMAIL PROTECTED]> writes: > 1.1 For this case acquiring SInval lock before ReadNewTransactionId() > changes behavior of Tx Old: it postpones change of Tx Old' > (and Tx New') MyProc->xid in xact.c:CommitTransaction(), so Tx S > will see Tx Old as running, ie Tx Old'

RE: [HACKERS] Re: Strangeness in xid allocation / snapshot setup

2001-07-12 Thread Mikheev, Vadim
> > You forget about Tx Old! The point is that changes made by > > Tx Old *over* Tx New' changes effectively make those Tx New' > > changes *visible* to Tx S! > > Yes, but what's that got to do with the order of operations in > GetSnapshotData? The scenario you describe can occur anyway. Try to