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 <cn>
>
> (some variant as SNAPSHOT FROM COMMIT NUMBER or SNAPSHOT BASE COMMIT
> NUMBER may be acceptable)
maybe:
SET TRANSACTION SNAPSHOT [USING SNAPSHOT <N>]
or
SET TRANSACTION SNAPSHOT [USING SNAPSHOT NUMBER <N>]
What I dislike here is double SNAPSHOT words.
Same concerns here
> TPB: isc_tpb_snapshot_commit_number, <commit number length> <commit
number>
isc_tpb_snapshot_number <len> <value>
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