Home » Server Options » RAC & Failsafe » PastImage concep (11,12, Linux)
PastImage concep [message #645363] Fri, 04 December 2015 06:53 Go to next message
piotrtal
Messages: 168
Registered: June 2011
Location: Poland/Czestochowa
Senior Member
Hello Gurus,

let me paste quote from http://www.dba-oracle.com/real_application_clusters_rac_grid/past_image.htm

########
The past image concept was introduced in the RAC version of Oracle 9i to maintain data integrity. In an Oracle database, a typical data block is not written to the disk immediately, even after it is dirtied. When the same dirty data block is requested by another instance for write or read purposes, an image of the block is created at the owning instance, and only that block is shipped to the requesting instance. This backup image of the block is called the past image (PI) and is kept in memory. In the event of failure, Oracle can reconstruct the current version of the block by reading PIs. It is also possible to have more than one past image in the memory depending on how many times the data block was requested in the dirty stage.

A past image copy of the data block is different from a CR block, which is needed for reconstructing a read-consistent image. A CR version of a block represents a consistent snapshot of the data at a point in time. It is constructed by applying information from the undo/rollback segments. The PI image copy helps the recovery process and aids in maintaining data integrity.

For example, suppose user A of instance 1 has updated row 2 on block 5. Later, user B of instance 2 intends to update row 6 on the same block 5. The GCS transfers block 5 from instance A to instance B. At this point, the past image (PI) for block 5 is created on instance A.
#########

my question is about details of above:

1. We have InstanceA and InstanceB.
2. InstanceB is currently modifying block (no commit yet)
3. When InstanceA request block for modification, PI is created on InstanceB and block is sent to InstanceA

and from that moment I have question.
q1) Which block is send to InstanceA? - PI or currently being modified (dirty one)?
q2) And what with its existence on InstanceB? - it is being moved or copied from InstanceB into InstanceA ?

Thanks

Piotr
Re: PastImage concep [message #645366 is a reply to message #645363] Fri, 04 December 2015 07:06 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
That description pf PI block is wrong. PIs are just hanging about, being useless. They aren't any sort of "backup", they aren't sent anywhere, they aren't used for reconstructing anything. A PI block is a block that was XCUR, but has been copied to another instance - that's all. It will become CR when the DBWn of the remote instance writes the later image to disc.
Re: PastImage concep [message #645368 is a reply to message #645366] Fri, 04 December 2015 08:04 Go to previous messageGo to next message
piotrtal
Messages: 168
Registered: June 2011
Location: Poland/Czestochowa
Senior Member
Thanks John,

I see only such explanations/descriptions/function of PI block in RAC instance as I provided.
Many sources:

http://avdeo.com/2008/07/21/oracle-rac-10g-cache-fusion/
https://www.linkedin.com/pulse/cache-fusion-oracle-rac-zaheer-abbas-mitaigiri
http://www.datadisk.co.uk/html_docs/rac/cache_fusion.htm#past_image

You mentioned --> "A PI block is a block that was XCUR, but has been copied to another instance"

So if InstanceA request block for modification from InstanceB
1. InstanceB is copying block (create PI) - just peforms copying without applying UNDO?
2. XCUR block is sent to InstanceA, but its being sent or moved? does InstanceB contain this block still in memory? im asking because transations is still not commited on instanceB.

Thanks.

Piotr

Re: PastImage concep [message #645370 is a reply to message #645368] Fri, 04 December 2015 08:41 Go to previous messageGo to next message
J.Schnackenberg
Messages: 2
Registered: June 2015
Junior Member
The site cited in the original post is generally either rubbish or copy-and-pasted content from somewhere else (or both). Exceptions to this rule might be possible.

In this case, it's more or less a rephrasing of the 9i-documentation: https://docs.oracle.com/cd/B10501_01/rac.920/a96597/coord.htm

Yes, Past Image blocks are used to "recover" (read: recreate) versions of a block that are read-consistent for a specific time.

The Past Image is not send to other instances. It is kept when sending a modified block to another instance. The other instances use UNDO (and possibly REDO) to generate a block with the needed read-consistent information in it for the target-session.

A little more details can be found in this presentation: http://www.juliandyke.com/Presentations/Presentations.html#InsideRAC

Regards,
Jan
Re: PastImage concep [message #645371 is a reply to message #645368] Fri, 04 December 2015 08:50 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member

Quote:
So if InstanceA request block for modification from InstanceB
1. InstanceB is copying block (create PI) - just peforms copying without applying UNDO?
2. XCUR block is sent to InstanceA, but its being sent or moved? does InstanceB contain this block still in memory? im asking because transations is still not commited on instanceB.



I think you may be confusing transactional consistency with block consistency. The cache fusion mechanism doesn't care about COMMIT. When you, for example, lock a row you are in fact writing to the block header: so you need the XCUR block. When you release a lock, you are again writing to the block.

Your point (1) shows a misunderstanding. All writes to a block must be to the current version, which is why you need the XCUR mode. So if A wants to modify the block, B sends a copy of the current version - no way is there application of undo. And it flags its own copy of the block as PI, because it is now out of date (or will be very soon.
Re: PastImage concep [message #645373 is a reply to message #645371] Fri, 04 December 2015 08:57 Go to previous messageGo to next message
piotrtal
Messages: 168
Registered: June 2011
Location: Poland/Czestochowa
Senior Member
John,

CR is clear for me, but PI not. CR is for read consistency. PI appears only i RAC.
That is why I asked about details of this PI cration process and raised those two questions.
So PI means exact copy of modified block, and InstanceB from that moment has two the same blocks which does not differ.

Thanks for answering so far. I will try process this and back in case of concerns.

Piotr
Re: PastImage concep [message #645374 is a reply to message #645370] Fri, 04 December 2015 09:01 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
I had a look at the docs, Jan, and yes, they do say "...The GCS manages past images and the GCS also uses them in failure recovery...." which is what Julian Dyke repeats. Do you actually believe it? I cannot visualize how a PI would be used for any form of recovery. It exists only in memory, not on disc. Possibly this is just a doc error that has being perpetuated. Or, possibly, it is the truth and I just don't understand it.

By the way, that Julian Dyke presentation is horrific: 106 slides! Death by Powerpoint!!



Re: PastImage concep [message #645375 is a reply to message #645373] Fri, 04 December 2015 09:04 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
piotrtal wrote on Fri, 04 December 2015 14:57
John,

CR is clear for me, but PI not. CR is for read consistency. PI appears only i RAC.
That is why I asked about details of this PI cration process and raised those two questions.
So PI means exact copy of modified block, and InstanceB from that moment has two the same blocks which does not differ.

Thanks for answering so far. I will try process this and back in case of concerns.

Piotr
How many more times do I have to say that the block becomes a PI block when it has been transferred? Of course B doesn't create another copy. The PI is just sitting there, probably just a waste of space.

[Updated on: Fri, 04 December 2015 09:05]

Report message to a moderator

Re: PastImage concep [message #645376 is a reply to message #645363] Fri, 04 December 2015 09:09 Go to previous messageGo to next message
bpeasland
Messages: 51
Registered: February 2015
Location: United States
Member

piotrtal wrote on Fri, 04 December 2015 06:53


q1) Which block is send to InstanceA? - PI or currently being modified (dirty one)?



Neither. The transaction has yet to commit. So the dirty block can't be sent. The PI block is only there for recovery purposes, so it won't be sent. What will be sent is a Consistent Read image of the block.

For the second question, the PI block doesn't get copied to the other instance. It stays on the instance it was created for. Its just used for recovery of the transaction. The PI block is not used to support other transactions, and not for SELECT statements.


Cheers,
Brian
Re: PastImage concep [message #645377 is a reply to message #645376] Fri, 04 December 2015 09:13 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
Quote:
The transaction has yet to commit. So the dirty block can't be sent.
Brian, you missed the point: in Piotr's example, A wants to modify the block, not just read it.
Re: PastImage concep [message #645378 is a reply to message #645374] Fri, 04 December 2015 09:20 Go to previous messageGo to next message
J.Schnackenberg
Messages: 2
Registered: June 2015
Junior Member
John Watson wrote on Fri, 04 December 2015 16:01
I had a look at the docs, Jan, and yes, they do say "...The GCS manages past images and the GCS also uses them in failure recovery...." which is what Julian Dyke repeats. Do you actually believe it? I cannot visualize how a PI would be used for any form of recovery. It exists only in memory, not on disc.


I'm really, really unsure about the details here, but yes, I do believe it. Keep in mind, this PI will only be kept until the block is flushed to disk by some other instance. If there are only two instances, Instance A has a PI-block, Instance B (which has the newest version of the block) crashes. Now Instance A can read the redo from Instance B and apply it directly to this PI. No need to also read the block itself. So yes, it's a failure recovery. For one block this might seem irrelevant, but usually we'll have lot's of blocks in memory and in RAC there'll usually be quite a bit of these PIs floating around. The less optimized an application is for RAC, the more there'll be. And for recovery from an instance crash, when lot's of sessions will try to connect to the remaining instance, you'll want to do this crash recovery as fast as possible.


Quote:
By the way, that Julian Dyke presentation is horrific: 106 slides! Death by Powerpoint!!


I referred to it, I didn't say I like it. Wink

Regards,
Jan
Re: PastImage concep [message #645379 is a reply to message #645378] Fri, 04 December 2015 09:25 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
I think you have it, Jan. Yes, I can see how a PI could be used like that for recovery. That also explains why once the remote instance has has checkpointed the block to disc, the PI gets flagged as CR (which I mentioned in my first post here). You wouldn't want to use it for recovery after it has been checkpointed somewhere else.
Re: PastImage concep [message #645382 is a reply to message #645363] Fri, 04 December 2015 09:43 Go to previous message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
let me paste quote from...


Forget this site, it is just b......t.
Some things are correct, mostly those that are copied from other sites or documents, the rest is plain wrong and you can't know what is correct and what is wrong.
So the best behavior is to close the window without reading it when you accidentally access one of its pages.

Previous Topic: GCS Log Flush Sync - don't understand
Next Topic: Extended (Distance / Stretched) RAC Cluster with Existing Setup.
Goto Forum:
  


Current Time: Thu Mar 28 07:58:26 CDT 2024