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

2019-02-24 Thread Adriano dos Santos Fernandes

On 24/02/2019 08:23, Vlad Khorsun wrote:



 > TPB: isc_tpb_snapshot_commit_number,  



         isc_tpb_snapshot_number  

    Regards,
    Vlad

    PS we also must add isc_info_tra_snapshot_number and, probably, 
context variable.




Don't we already have context SNAPSHOT_CN? It already has the same 
meaning of the new feature, so therefore what context you would want 
to add?


  SNAPSHOT_CN returns snapshot number of current request if 
transaction is read-committed read
consistency (RCRC). But... after more thinking i consider it is ok to 
use it for snapshot cloning.
Additional variable returning NULL for RCRC transactions will add more 
confusing. From the other
side - there is no problem to clone any kind of existing snapshot. 
Users must be warned that snapshot
transaction which cloned request-level snapshot of another RCRC 
transaction will see same data at
base request and subsequent requests in the base RCR transaction could 
see another data.


Yes, and that is already possible as an implementation side effect. It 
should be extremely discouraged, except for cases like long running 
request detected via monitoring that one wants to debug in another 
connection.



  I also suggest that new isc_info_tra_snapshot_number returns the 
same data as SNAPSHOT_CN variable.


Yes, no problem. But for RC it will be NULL as there is no request.




And then SNAPSHOT_CN means "SNAPSHOT COMMIT NUMBER", it's the reason 
for the syntax that I offered.


  We can change it, if needed. Note, I introduced two variables: 
GLOBAL_CN and SNAPSHOT_CN and its
names looks logical and consistent to me (at least at that time). I 
see no problem to change names

to something better.

Yes, the names must match as SNAPSHOT_CN means same thing as the clause 
passed to SET TRANSACTION.



Adriano



Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


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

2019-02-24 Thread Vlad Khorsun

24.02.2019 12:37, Dimitry Sibiryakov wrote:

24.02.2019 3:23, Adriano dos Santos Fernandes wrote:

    maybe:
         SET TRANSACTION SNAPSHOT [USING SNAPSHOT ]
    or
         SET TRANSACTION SNAPSHOT [USING SNAPSHOT NUMBER ]

What I dislike here is double SNAPSHOT words.


   You can make it optional.


  No objection from my side

Regards,
Vlad


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


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

2019-02-24 Thread Vlad Khorsun

24.02.2019 4:23, Adriano dos Santos Fernandes wrote:

On Sat, Feb 23, 2019, 21:30 Vlad Khorsun wrote:

23.02.2019 21:14, Adriano dos Santos Fernandes wrote:
 > Hi!
 >
 > After changes to use commit number instead of base transaction number, I
 > offer to make that interfaces for the feature:

    I offer to not introduce additional confusing with different usages of 
commit
numbers.

    Commit Number (CN) itself is an unique value assigned to the every 
committed
transaction. The source of that value is per-database counter. When some 
database
snapshot is created it uses current value of database counter of commit 
numbers
as own identifier. Lets name it Snapshot Number (SN) to distinguish from 
Commit
Number assigned to transaction. The sourse of CN and SN is the same, but 
usage
and meaning is very different !

    Therefore

 > SQL command: SET TRANSACTION SNAPSHOT COMMIT NUMBER 
 >
 > (some variant as SNAPSHOT FROM COMMIT NUMBER or SNAPSHOT BASE COMMIT
 > NUMBER may be acceptable)

maybe:
         SET TRANSACTION SNAPSHOT [USING SNAPSHOT ]
or
         SET TRANSACTION SNAPSHOT [USING SNAPSHOT NUMBER ]


What I dislike here is double SNAPSHOT words.


  Same concerns here


 > TPB: isc_tpb_snapshot_commit_number,  

         isc_tpb_snapshot_number  

Regards,
Vlad

PS we also must add isc_info_tra_snapshot_number and, probably, context 
variable.



Don't we already have context SNAPSHOT_CN? It already has the same meaning of the new feature, so therefore what context you would 
want to add?


  SNAPSHOT_CN returns snapshot number of current request if transaction is 
read-committed read
consistency (RCRC). But... after more thinking i consider it is ok to use it 
for snapshot cloning.
Additional variable returning NULL for RCRC transactions will add more 
confusing. From the other
side - there is no problem to clone any kind of existing snapshot. Users must 
be warned that snapshot
transaction which cloned request-level snapshot of another RCRC transaction 
will see same data at
base request and subsequent requests in the base RCR transaction could see 
another data.

  I also suggest that new isc_info_tra_snapshot_number returns the same data as 
SNAPSHOT_CN variable.


And then SNAPSHOT_CN means "SNAPSHOT COMMIT NUMBER", it's the reason for the 
syntax that I offered.


  We can change it, if needed. Note, I introduced two variables: GLOBAL_CN and 
SNAPSHOT_CN and its
names looks logical and consistent to me (at least at that time). I see no 
problem to change names
to something better.

Regards,
Vlad

PS As for me, "Snapshot Commit Number" is full name for (more usable) "Snapshot Number". 
"Snapshot CN"
just another way to make full name shorter. We need to choose some consistent 
way to name the things
before final release.


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


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

2019-02-24 Thread Dimitry Sibiryakov

24.02.2019 3:23, Adriano dos Santos Fernandes wrote:

maybe:
         SET TRANSACTION SNAPSHOT [USING SNAPSHOT ]
or
         SET TRANSACTION SNAPSHOT [USING SNAPSHOT NUMBER ]

What I dislike here is double SNAPSHOT words.


  You can make it optional.

--
  WBR, SD.


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel