Re: log-begin on new transactions (7.11.UC1)
Posted in 1997
In article <E5EBqs.Mpz@nonexistent.com>, Jacob Salomon
<jake@apparel.net> writes
>Hi all,
>Warning 1: You may have to widen your windows for this. Sorry.
>
Nope - luucky me!
>Just some notes and wheel-inventing for OnLine admin folks.
>
>I was testing out some scripts on sysmaster and ran into strange
>situation.
>
>Window1: begin work;
> set isolation to cursor stability;>
>window2: onstat -ux # Obviously edited to isolate my session
>
>Userthreads
>address flags sessid user tty wait tout locks nreads
>nwrites
>c1fabf1c Y--P--- 13391 jake ttyq0 c2f963f0 0 1 6
>4
>
>Transactions
>address flags userthread locks log begin isolation retrys coordinator
>c1fcba4c A---- c1fabf1c 1 0 CURSOR 0
>
>Notice: That's my transaction being described; I promise it's the only
>one with that isolation level. So the in-memory array of transaction
>info describes this transaction but the log-begin is 0. This tells me
>there is nothing on disk or the log buffer describibg this transaction.
SOunds reaonsable - it too late to bother wade throught the manuals,
I'll believe you.
>In hindsight, I suppose this may be reasonable; if the system were to
>crash now, it would not have to bother rolling back this transaction
>which has not yet done a blessed thing to the database.
>
Correct.
>Now, back to the experiment:
>
>Window1: delete from cust_tab where customer = "00002"
>Window2: onstat -x
>Transactions
>address flags userthread locks log begin isolation retrys coordinator
>c1fcba4c A-B-- c1fabf1c 5 157 CURSOR 0
>
>Suddenly, log-begin is at uniq log sequence number 157. (Yes, that is my
>current log at the moment.) Now something *has* happened to the
>database.
>
>Why is this a problem for me?
>
>Well, the experiment started as a result of people asking if there was a
>way to determine which logs are free-able under the newer scheme in
>OnLine, wherein the F flag is never again set once a log file has been
>used. (There are sound reasons for that which I do not dispute; it's
>the side effect that causes the gluteal pain.) The script I was trying
>to piece together involved
> min(syslogs.begin) where begin > 0
>However, this discovery throws a monkey wrench into the query.
>
>If anyone knows a way around this, or if this behavior changes in later
>releases of OnLine, please post a reply.
There is no monkey wrench - looks like the begin work record only gets
written to the logical log once some other record needs to be written.
in-memory entry is created in transaction table to note that a
transaction has started i.e. we are now in a transaction. However
a statement which needs to be logged is executed then nothing is
logged i.e. a begin work record is not yet written to the logical log.
This means that you original calculation about which logical log
is free is correct!
PS I'll try onlog-ing this one tomorrow.
--
David Williams