05.05.2017 20:36, Adriano dos Santos Fernandes wrote:
> On 05/05/2017 14:01, Vlad Khorsun :

...

>>     I don't understand for what purpose tra_oldest_snapshot was added.
> In my understand, it's a property that new transaction should copy from
> the base transaction. Isn't it?

   No. Re-evaluated value of OST is stored at jrd_trans::tra_oldest_active.

> Should I let the original code assign it even for new transactions
> that's sharing a snapshot?

   No.

> But please read answear bellow, may be important for it.
> 
> 
>> Also it is not clear why "base_number" variable is introduced in 
>> transaction_start()
>> and why it replaces "number" in many places.
> 
> When first normal (not with sharing snapshot option) transaction is
> started, it must record others transaction snapshot until its own *number*.
> 
> When second (with sharing snapshot option) transaction is started,
> *number* has its new number too, but the snapshot vector must be record
> only to the *base_number*, i.e., its snapshot vector should be identical
> to the first transaction.

   If you worry about high bound of transaction's copy of TIP 
(tra_transactions) -
it is already stored at jrd_trans::tra_top.

   BTW, transaction should export own snapshot at the end of 
transaction_start(),
because it is the moment when all it fields got actual values (especially
tra_oldest_active).

   Probably, transaction which import snapshot, should avoid recalculation of
OIT and OST. At least, it should not update own tra_oldest_active with new
value of OST.

Regards,
Vlad

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to