<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Distributed Oddity</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Fri, 17 May 2013 13:58:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/#comment-162</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Wed, 15 Nov 2006 07:58:10 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/#comment-162</guid>
		<description><![CDATA[Alberto,  I agree - perfect synchronization is not possible; but on a superficial examination moving to the higher SCN would appear to avoid the original problem.

I start a query at SCN 500, and move to the remote site - if your SCN is 510 I return to the local site, jump the SCN and restart my query. If your SCN is 490 you jump your SCN and I continue.

&quot;Superficial&quot; because of the complexities of high concurrency, queries originating at both ends simultaneously, three-node queries and network latency issues. The strategy of synchronising at the end seems to be a sensible compromise between closest match and least contentious.]]></description>
		<content:encoded><![CDATA[<p>Alberto,  I agree &#8211; perfect synchronization is not possible; but on a superficial examination moving to the higher SCN would appear to avoid the original problem.</p>
<p>I start a query at SCN 500, and move to the remote site &#8211; if your SCN is 510 I return to the local site, jump the SCN and restart my query. If your SCN is 490 you jump your SCN and I continue.</p>
<p>&#8220;Superficial&#8221; because of the complexities of high concurrency, queries originating at both ends simultaneously, three-node queries and network latency issues. The strategy of synchronising at the end seems to be a sensible compromise between closest match and least contentious.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alberto Dell'Era</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/#comment-160</link>
		<dc:creator><![CDATA[Alberto Dell'Era]]></dc:creator>
		<pubDate>Tue, 14 Nov 2006 21:57:43 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/#comment-160</guid>
		<description><![CDATA[&lt;i&gt;you don’t have to freeze SCNs&lt;/i&gt;

Say the local instance receives a message from the remote one:
&quot;my current SCN is 123&quot;
actually the meaning is
&quot;my current SCN &lt;i&gt;was&lt;/i&gt; 123, n milliseconds ago&quot;
where &quot;n milliseconds&quot; is the network latency, which is unknown [but even if it were known, it wouldn&#039;t add information - since the remote SCN when the message is received can be anything between 123 and 123+(some thousands)].

Moving the lower SCN to the value of the higher SCN is just (thinking out loud as well) just a clever trick to avoid maintaining a remote-local SCN map; it can&#039;t cure the fundamental (physical) problem outlined above.

Without freezing SCNs (stopping time on the two physical reference frames) - I can&#039;t imagine a way to synchronize perfectly the SCNs on the two instances. So, perfect distributed read consistency cannot be achieved (again, without freezing, which is something very unscalable and prone to disaster if the network goes down just after freezing).]]></description>
		<content:encoded><![CDATA[<p><i>you don’t have to freeze SCNs</i></p>
<p>Say the local instance receives a message from the remote one:<br />
&#8220;my current SCN is 123&#8243;<br />
actually the meaning is<br />
&#8220;my current SCN <i>was</i> 123, n milliseconds ago&#8221;<br />
where &#8220;n milliseconds&#8221; is the network latency, which is unknown [but even if it were known, it wouldn't add information - since the remote SCN when the message is received can be anything between 123 and 123+(some thousands)].</p>
<p>Moving the lower SCN to the value of the higher SCN is just (thinking out loud as well) just a clever trick to avoid maintaining a remote-local SCN map; it can&#8217;t cure the fundamental (physical) problem outlined above.</p>
<p>Without freezing SCNs (stopping time on the two physical reference frames) &#8211; I can&#8217;t imagine a way to synchronize perfectly the SCNs on the two instances. So, perfect distributed read consistency cannot be achieved (again, without freezing, which is something very unscalable and prone to disaster if the network goes down just after freezing).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy C</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/#comment-159</link>
		<dc:creator><![CDATA[Andy C]]></dc:creator>
		<pubDate>Tue, 14 Nov 2006 20:40:18 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/#comment-159</guid>
		<description><![CDATA[I once worked with an Irish developer who also committed his commits twice.

When I asked why he replied &#039;To be sure, to be sure&#039;.

Alternatively, is this an example of &#039;two-phase commit&#039; ?]]></description>
		<content:encoded><![CDATA[<p>I once worked with an Irish developer who also committed his commits twice.</p>
<p>When I asked why he replied &#8216;To be sure, to be sure&#8217;.</p>
<p>Alternatively, is this an example of &#8216;two-phase commit&#8217; ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glenn</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/#comment-157</link>
		<dc:creator><![CDATA[Glenn]]></dc:creator>
		<pubDate>Tue, 14 Nov 2006 13:55:30 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/#comment-157</guid>
		<description><![CDATA[We had a developer here at work that always committed his commits twice.  We laughed at him but maybe he was onto something!  Maybe he ran into this &quot;undocumented feature&quot; but his reasoning was always &quot;to make sure it is committed&quot;.

Thanks for blogging.  Always something new and interesting.]]></description>
		<content:encoded><![CDATA[<p>We had a developer here at work that always committed his commits twice.  We laughed at him but maybe he was onto something!  Maybe he ran into this &#8220;undocumented feature&#8221; but his reasoning was always &#8220;to make sure it is committed&#8221;.</p>
<p>Thanks for blogging.  Always something new and interesting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alessandro Deledda</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/#comment-154</link>
		<dc:creator><![CDATA[Alessandro Deledda]]></dc:creator>
		<pubDate>Tue, 14 Nov 2006 12:43:39 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/#comment-154</guid>
		<description><![CDATA[“set transaction readonly” could not work due to Bug No. 3258015
 
&quot;Fixed in Product Version: No Data&quot;

seems to be very interesting for this argument the following metalink note/bug:

https://metalink.oracle.com/metalink/plsql/ml2_documents.showFrameDocument?p_database_id=BUG&amp;p_id=2661680]]></description>
		<content:encoded><![CDATA[<p>“set transaction readonly” could not work due to Bug No. 3258015</p>
<p>&#8220;Fixed in Product Version: No Data&#8221;</p>
<p>seems to be very interesting for this argument the following metalink note/bug:</p>
<p><a href="https://metalink.oracle.com/metalink/plsql/ml2_documents.showFrameDocument?p_database_id=BUG&#038;p_id=2661680" rel="nofollow">https://metalink.oracle.com/metalink/plsql/ml2_documents.showFrameDocument?p_database_id=BUG&#038;p_id=2661680</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/#comment-153</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 14 Nov 2006 11:43:38 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/#comment-153</guid>
		<description><![CDATA[Fairlie, thanks for that note. I think that is exactly the issue; and the comments (despite being 1999 and 7.3.4) are still apt. 

Alberto, I agree with the general premise - but you don&#039;t have to freeze SCNs, you only have to move the lower SCN to at least the value of the higher SCN - which could be done in one round trip from the caller. This is (presumably) why the commit/rollback trick works.

Incidentally, there is an interesting underlying issue anyway. A distributed join that operates as a &lt;b&gt;nested loop&lt;/b&gt; need not give a read-consistent result, as the repeated execution of the query that gets second rowsource may operate at a different SCN every time - unless you start with &lt;i&gt;&quot;set transaction readonly&quot;&lt;/i&gt; or do something with the isolation level.  So perhaps the &#039;solution&#039; to the problem is to remind people that they need that first step anyway, as that step probably performs the required synchronisation anyway.
(That&#039;s also &lt;i&gt;&quot;thinking out loud&quot;&lt;/i&gt; - to be tested, not trusted).]]></description>
		<content:encoded><![CDATA[<p>Fairlie, thanks for that note. I think that is exactly the issue; and the comments (despite being 1999 and 7.3.4) are still apt. </p>
<p>Alberto, I agree with the general premise &#8211; but you don&#8217;t have to freeze SCNs, you only have to move the lower SCN to at least the value of the higher SCN &#8211; which could be done in one round trip from the caller. This is (presumably) why the commit/rollback trick works.</p>
<p>Incidentally, there is an interesting underlying issue anyway. A distributed join that operates as a <b>nested loop</b> need not give a read-consistent result, as the repeated execution of the query that gets second rowsource may operate at a different SCN every time &#8211; unless you start with <i>&#8220;set transaction readonly&#8221;</i> or do something with the isolation level.  So perhaps the &#8216;solution&#8217; to the problem is to remind people that they need that first step anyway, as that step probably performs the required synchronisation anyway.<br />
(That&#8217;s also <i>&#8220;thinking out loud&#8221;</i> &#8211; to be tested, not trusted).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fairlie Rego</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/#comment-150</link>
		<dc:creator><![CDATA[Fairlie Rego]]></dc:creator>
		<pubDate>Tue, 14 Nov 2006 01:55:41 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/#comment-150</guid>
		<description><![CDATA[Just thinking aloud here..
Looks like a similar issue to
Bug 611416
SELECT AFTER UPDATE AND COMMIT DOESN&#039;T SHOW UPDATED COLUMNS 
which has been accepted as a limitation.]]></description>
		<content:encoded><![CDATA[<p>Just thinking aloud here..<br />
Looks like a similar issue to<br />
Bug 611416<br />
SELECT AFTER UPDATE AND COMMIT DOESN&#8217;T SHOW UPDATED COLUMNS<br />
which has been accepted as a limitation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alberto Dell'Era</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/#comment-149</link>
		<dc:creator><![CDATA[Alberto Dell'Era]]></dc:creator>
		<pubDate>Mon, 13 Nov 2006 22:53:41 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/13/distributed-oddity/#comment-149</guid>
		<description><![CDATA[Just noticed that the same happens by swapping the versions - INST1 on 10g, INST2 on 9i.

But I think that this is unavoidable, since you can&#039;t have perfect read consistency between two different databases, since they don&#039;t share a common &quot;time reference frame&quot; - by the time the statement reaches the remote database, the remote time/SCN has changed (speed of light being finite ...).

It is simply not possible to map the SCNs on the two databases, unless they both freeze their scn, exchange their currect values, and then unfreeze the SCNs - which is simply not scalable; this test case is the perfect counterexample that this does not happen.

So after the Schrodinger effect, we have an Einstein effect as well :)]]></description>
		<content:encoded><![CDATA[<p>Just noticed that the same happens by swapping the versions &#8211; INST1 on 10g, INST2 on 9i.</p>
<p>But I think that this is unavoidable, since you can&#8217;t have perfect read consistency between two different databases, since they don&#8217;t share a common &#8220;time reference frame&#8221; &#8211; by the time the statement reaches the remote database, the remote time/SCN has changed (speed of light being finite &#8230;).</p>
<p>It is simply not possible to map the SCNs on the two databases, unless they both freeze their scn, exchange their currect values, and then unfreeze the SCNs &#8211; which is simply not scalable; this test case is the perfect counterexample that this does not happen.</p>
<p>So after the Schrodinger effect, we have an Einstein effect as well :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
