Author: frm
Date: Wed Oct 12 11:46:07 2016
New Revision: 1764442

URL: http://svn.apache.org/viewvc?rev=1764442&view=rev
Log:
OAK-4926 - Avoid throwing SNFEs when checking for locally available segments

Modified:
    
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/standby/client/StandbyClientSyncExecution.java

Modified: 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/standby/client/StandbyClientSyncExecution.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/standby/client/StandbyClientSyncExecution.java?rev=1764442&r1=1764441&r2=1764442&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/standby/client/StandbyClientSyncExecution.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/standby/client/StandbyClientSyncExecution.java
 Wed Oct 12 11:46:07 2016
@@ -200,20 +200,10 @@ class StandbyClientSyncExecution {
     }
 
     private boolean isLocal(UUID id) {
-        SegmentId referencedId = store.newSegmentId(
+        return store.containsSegment(store.newSegmentId(
                 id.getMostSignificantBits(),
                 id.getLeastSignificantBits()
-        );
-
-        boolean persisted = true;
-
-        try {
-            referencedId.getSegment();
-        } catch(SegmentNotFoundException e) {
-            persisted = false;
-        }
-
-        return persisted;
+        ));
     }
 
     private void copySegmentFromPrimary(UUID uuid) throws Exception {


Reply via email to