You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2014/04/09 13:37:21 UTC

svn commit: r1585940 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java

Author: reschke
Date: Wed Apr  9 11:37:21 2014
New Revision: 1585940

URL: http://svn.apache.org/r1585940
Log:
OAK-1266 - improve recovery after create race condition

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java?rev=1585940&r1=1585939&r2=1585940&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java Wed Apr  9 11:37:21 2014
@@ -341,7 +341,10 @@ public class RDBDocumentStore implements
                 return oldDoc;
             } catch (MicroKernelException ex) {
                 // may have failed due to a race condition; try update instead
-                oldDoc = readDocumentCached(collection, update.getId(), Integer.MAX_VALUE);
+                // this is an edge case, so it's ok to bypass the cache
+                // (avoiding a race condition where the DB is already updated
+                // but the case is not)
+                oldDoc = readDocumentUncached(collection, update.getId());
                 if (oldDoc == null) {
                     // something else went wrong
                     LOG.error("insert failed, but document " + update.getId() + " is not present, aborting", ex);