Re: [Firebird-devel] Start transaction from base transaction

2017-05-05 Thread Vlad Khorsun
06.05.2017 0:17, Adriano dos Santos Fernandes wrote:
> Em 05/05/2017 18:01, Vlad Khorsun escreveu:
> 
>>
>> Also, i offer to add additional rule for transaction which should export
>> its snapshot data (it allows to avoid export by all transactions), something
>> like:
>>
>> SET TRANSACTION ISOLATION LEVEL SNAPSHOT WITH SHARED SNAPSHOT
>>
> 
> As we talk about active transactions, why did you want to "export"
> snapshot explicitly instead of share the data already available like I
> did (badly implemented yet, but possible) when requested by who want it?

   To avoid work and resources overhead when it is not required. Agree, snapshot
of a far not every transaction will be ever used by another transaction.

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


Re: [Firebird-devel] Start transaction from base transaction

2017-05-05 Thread Adriano dos Santos Fernandes
Em 05/05/2017 18:01, Vlad Khorsun escreveu:

> 
>Also, i offer to add additional rule for transaction which should export
> its snapshot data (it allows to avoid export by all transactions), something
> like:
> 
>SET TRANSACTION ISOLATION LEVEL SNAPSHOT WITH SHARED SNAPSHOT
> 

As we talk about active transactions, why did you want to "export"
snapshot explicitly instead of share the data already available like I
did (badly implemented yet, but possible) when requested by who want it?


Adriano

--
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


Re: [Firebird-devel] Start transaction from base transaction

2017-05-05 Thread Vlad Khorsun
05.05.2017 21:10, Adriano dos Santos Fernandes wrote:
> On 05/05/2017 14:43, Dmitry Yemanov wrote:
>> 05.05.2017 20:01, Vlad Khorsun wrote:
>>> %type  snap_shot
>>> snap_shot
>>> : SNAPSHOT
>>> | SNAPSHOT TABLE
>>> | SNAPSHOT TABLE STABILITY
>>> +   | SNAPSHOT SHARING FROM 
>> SNAPSHOT BASED ON 
>> ?
>>
> Do you think with this words it's clear that the new transaction uses
> the same snapshot used in , instead of incorrectly saying that it
> will use  as the snapshot for the new transaction?
> 
> Thinking in these terms, I'm more inclined to adapt (renaming SHARING to
> SHARED) Vlad's syntax to:
> 
> SET TRANSACTION ISOLATION LEVEL SNAPSHOT SHARED FROM 

   For me both variants are OK :) Probably native english speakers could
offer something better and less ambiguous.

   Also, i offer to add additional rule for transaction which should export
its snapshot data (it allows to avoid export by all transactions), something
like:

   SET TRANSACTION ISOLATION LEVEL SNAPSHOT WITH SHARED SNAPSHOT

Not sure i like it :)

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


Re: [Firebird-devel] Start transaction from base transaction

2017-05-05 Thread Vlad Khorsun
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


Re: [Firebird-devel] Start transaction from base transaction

2017-05-05 Thread Adriano dos Santos Fernandes
On 05/05/2017 14:43, Dmitry Yemanov wrote:
> 05.05.2017 20:01, Vlad Khorsun wrote:
>> %type   snap_shot
>> snap_shot
>>  : SNAPSHOT
>>  | SNAPSHOT TABLE
>>  | SNAPSHOT TABLE STABILITY
>> +| SNAPSHOT SHARING FROM 
> SNAPSHOT BASED ON 
> ?
>
Do you think with this words it's clear that the new transaction uses
the same snapshot used in , instead of incorrectly saying that it
will use  as the snapshot for the new transaction?

Thinking in these terms, I'm more inclined to adapt (renaming SHARING to
SHARED) Vlad's syntax to:

SET TRANSACTION ISOLATION LEVEL SNAPSHOT SHARED FROM 


Adriano


--
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


Re: [Firebird-devel] Start transaction from base transaction

2017-05-05 Thread Dmitry Yemanov
05.05.2017 20:01, Vlad Khorsun wrote:
>
> %typesnap_shot
> snap_shot
>   : SNAPSHOT
>   | SNAPSHOT TABLE
>   | SNAPSHOT TABLE STABILITY
> + | SNAPSHOT SHARING FROM 

SNAPSHOT BASED ON 
?


Dmitry


--
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


Re: [Firebird-devel] Start transaction from base transaction

2017-05-05 Thread Adriano dos Santos Fernandes
On 05/05/2017 14:01, Vlad Khorsun wrote:
>
>It doesn't forces (nor expresses) new transaction isolation level to be 
> SNAPSHOT.

Yes, I forgot to inform it in comment for now.


> Probably, it would be more natural to extend "snap_shot" rule in parser:
>
> iso_mode
>   : snap_shot
>   | READ UNCOMMITTED version_mode
>   | READ COMMITTED version_mode
>   ;
>
> %typesnap_shot
> snap_shot
>   : SNAPSHOT
>   | SNAPSHOT TABLE
>   | SNAPSHOT TABLE STABILITY
> + | SNAPSHOT SHARING FROM 

I like it.


>Also, transaction_options() should verify\enforce isc_tpb_concurrency 
> isolation
> level for a new transaction.

Yes.


>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?

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

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.


Adriano


--
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


Re: [Firebird-devel] Start transaction from base transaction

2017-05-05 Thread Vlad Khorsun
05.05.2017 18:59, Adriano dos Santos Fernandes write:
> Vlad and others,
> 
> Can you look at this?
> 
> https://github.com/asfernandes/firebird/tree/work/sharing-snapshot

   I took a quick look, so don't get me too serious. Also, my opinion could be
incomplete and be changed later :)

> It uses the simplest possible (and bad) IPC mechanism to manually test
> the idea of get the snapshot from others processes.

   Yes, IPC\locking is a weak point (so far)

> It uses syntax: SET TRANSACTION SHARING SNAPSHOT FROM  number>

   It doesn't forces (nor expresses) new transaction isolation level to be 
SNAPSHOT.
Probably, it would be more natural to extend "snap_shot" rule in parser:

iso_mode
: snap_shot
| READ UNCOMMITTED version_mode
| READ COMMITTED version_mode
;

%type  snap_shot
snap_shot
: SNAPSHOT
| SNAPSHOT TABLE
| SNAPSHOT TABLE STABILITY
+   | SNAPSHOT SHARING FROM 

   Also, transaction_options() should verify\enforce isc_tpb_concurrency 
isolation
level for a new transaction.

> It is working in my tests.
> 
> Not talking about the IPC mechanism, is there any other trick needed?

   Ok, lets leave IPC\locking in peace for a while ;)

   I don't understand for what purpose tra_oldest_snapshot was added.
Also it is not clear why "base_number" variable is introduced in 
transaction_start()
and why it replaces "number" in many places.

   As for the tricks - so far i see no needs in something additional.
If we will decide to implement Sean's syntax with explicit "export" of 
transaction
snapshot, it could require some, though.

   Of course, IPC\locking should be reworked, but we agreed to not discuss it
at this stage.

Hope it helps,
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


Re: [Firebird-devel] Start transaction from base transaction

2017-05-05 Thread Adriano dos Santos Fernandes
Vlad and others,

Can you look at this?

https://github.com/asfernandes/firebird/tree/work/sharing-snapshot

It uses the simplest possible (and bad) IPC mechanism to manually test
the idea of get the snapshot from others processes.

It uses syntax: SET TRANSACTION SHARING SNAPSHOT FROM 

It is working in my tests.

Not talking about the IPC mechanism, is there any other trick needed?


Adriano


--
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


[Firebird-devel] [FB-Tracker] Created: (CORE-5532) add support for data type TINYINT (byte) Number of 0..255

2017-05-05 Thread Roberto Carlos da Silva (JIRA)
add support for data type TINYINT (byte) Number of 0..255
-

 Key: CORE-5532
 URL: http://tracker.firebirdsql.org/browse/CORE-5532
 Project: Firebird Core
  Issue Type: New Feature
  Components: Engine
Affects Versions: 4.0 Alpha 1, 4.0 Beta 1
Reporter: Roberto Carlos da Silva


Please add support for data type TINYINT (byte) Number of 0..255,
This would greatly facilitate the system migration developed for sql server, 
oracle or mysql.

reference:

https://dev.mysql.com/doc/refman/5.7/en/integer-types.html
https://msdn.microsoft.com/pt-br/library/ms187745.aspx

Thank you

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



--
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