[jira] [Updated] (OAK-7286) DocumentNodeStoreBranch handling of non-recoverable DocumentStoreExceptions

2019-06-25 Thread Julian Reschke (JIRA)


 [ 
https://issues.apache.org/jira/browse/OAK-7286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julian Reschke updated OAK-7286:

Description: 
In {{DocumentNodeStoreBranch.merge()}}, any {{DocumentStoreException}} is 
mapped to a {{DocumentStoreException}} to a {{CommitFailedException}} of type 
"MERGE", which leads to the operation being retried, and a non-helpful 
exception being generated.

The effect can be observed by enabling a test in {{ValidNamesTest}}:

{noformat}
--- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java 
(Revision 1825371)
+++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java 
(Arbeitskopie)
@@ -300,7 +300,6 @@
 public void testUnpairedHighSurrogateEnd() {
 // see OAK-5506
 
org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("segment"));
-
org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("rdb"));
 nameTest("foo" + SURROGATE_PAIR[0]);
 }

@@ -336,6 +335,7 @@
 assertEquals("paths should be equal", p.getPath(), n.getPath());
 return p;
 } catch (RepositoryException ex) {
+ex.printStackTrace();
 fail(ex.getMessage());
 return null;
 }

{noformat}

The underlying issue is that {{RDBDocumentStore}} is throwing a 
{{DocumentStoreException}} due to the invalid ID, and repeating the call will 
not help.

We probably should have a way to distinguish between different types of 
problems.

I hacked {{DocumentNodeStoreBranch}} like that:

{noformat}
--- 
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
(Revision 1825371)
+++ 
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
(Arbeitskopie)
@@ -520,8 +520,12 @@
 } catch (ConflictException e) {
 throw e.asCommitFailedException();
 } catch(DocumentStoreException e) {
-throw new CommitFailedException(MERGE, 1,
-"Failed to merge changes to the underlying store", 
e);
+if (e.getMessage().contains("Invalid ID")) {
+throw new CommitFailedException(OAK, 123,
+"Failed to store changes in the underlying 
store: " + e.getMessage(), e);
+} else {
+throw new CommitFailedException(MERGE, 1, "Failed to 
merge changes to the underlying store", e);
+}
 } catch (Exception e) {
 throw new CommitFailedException(OAK, 1,
 "Failed to merge changes to the underlying store", 
e);

{noformat}

...which causes the exception to surface immediately (see 
https://issues.apache.org/jira/secure/attachment/12912117/OAK-7286.diff).

(cc  [~mreutegg])



  was:
In {{DocumentNodeStoreBranch.merge()}}, any {{DocumentStoreException}} is 
mapped to a {{DocumentStoreException}} to a {{CommitFailedException}} of type 
"MERGE", which leads to the operation being retried, and a non-helpful 
exception being generated.

The effect can be observed by enabling a test in {{ValidNamesTest}}:

{noformat}
--- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java 
(Revision 1825371)
+++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java 
(Arbeitskopie)
@@ -300,7 +300,6 @@
 public void testUnpairedHighSurrogateEnd() {
 // see OAK-5506
 
org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("segment"));
-
org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("rdb"));
 nameTest("foo" + SURROGATE_PAIR[0]);
 }

@@ -336,6 +335,7 @@
 assertEquals("paths should be equal", p.getPath(), n.getPath());
 return p;
 } catch (RepositoryException ex) {
+ex.printStackTrace();
 fail(ex.getMessage());
 return null;
 }

{noformat}

The underlying issue is that {{RDBDocumentStore}} is throwing a 
{{DocumentStoreException}} due to the invalid ID, and repeating the call will 
not help.

We probably should have a way to dinstinguish between different types of 
problems.

I hacked {{DocumentNodeStoreBranch}} like that:

{noformat}
--- 
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
(Revision 1825371)
+++ 
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
(Arbeitskopie)
@@ -520,8 +520,12 @@
 } catch (ConflictException e) {
 throw e.asCommitFailedException();
 } catch(DocumentStoreException e) {
-throw new 

[jira] [Updated] (OAK-7286) DocumentNodeStoreBranch handling of non-recoverable DocumentStoreExceptions

2018-03-07 Thread Marcel Reutegger (JIRA)

 [ 
https://issues.apache.org/jira/browse/OAK-7286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marcel Reutegger updated OAK-7286:
--
Fix Version/s: (was: 1.9.0)

> DocumentNodeStoreBranch handling of non-recoverable DocumentStoreExceptions
> ---
>
> Key: OAK-7286
> URL: https://issues.apache.org/jira/browse/OAK-7286
> Project: Jackrabbit Oak
>  Issue Type: Task
>  Components: documentmk
>Reporter: Julian Reschke
>Assignee: Marcel Reutegger
>Priority: Major
> Fix For: 1.10
>
> Attachments: OAK-7286-DocumentStoreException.patch, 
> OAK-7286-DocumentStoreException.patch, OAK-7286.diff, OAK-7286.diff
>
>
> In {{DocumentNodeStoreBranch.merge()}}, any {{DocumentStoreException}} is 
> mapped to a {{DocumentStoreException}} to a {{CommitFailedException}} of type 
> "MERGE", which leads to the operation being retried, and a non-helpful 
> exception being generated.
> The effect can be observed by enabling a test in {{ValidNamesTest}}:
> {noformat}
> --- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java   
>   (Revision 1825371)
> +++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java   
>   (Arbeitskopie)
> @@ -300,7 +300,6 @@
>  public void testUnpairedHighSurrogateEnd() {
>  // see OAK-5506
>  
> org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("segment"));
> -
> org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("rdb"));
>  nameTest("foo" + SURROGATE_PAIR[0]);
>  }
> @@ -336,6 +335,7 @@
>  assertEquals("paths should be equal", p.getPath(), n.getPath());
>  return p;
>  } catch (RepositoryException ex) {
> +ex.printStackTrace();
>  fail(ex.getMessage());
>  return null;
>  }
> {noformat}
> The underlying issue is that {{RDBDocumentStore}} is throwing a 
> {{DocumentStoreException}} due to the invalid ID, and repeating the call will 
> not help.
> We probably should have a way to dinstinguish between different types of 
> problems.
> I hacked {{DocumentNodeStoreBranch}} like that:
> {noformat}
> --- 
> oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
> (Revision 1825371)
> +++ 
> oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
> (Arbeitskopie)
> @@ -520,8 +520,12 @@
>  } catch (ConflictException e) {
>  throw e.asCommitFailedException();
>  } catch(DocumentStoreException e) {
> -throw new CommitFailedException(MERGE, 1,
> -"Failed to merge changes to the underlying 
> store", e);
> +if (e.getMessage().contains("Invalid ID")) {
> +throw new CommitFailedException(OAK, 123,
> +"Failed to store changes in the underlying 
> store: " + e.getMessage(), e);
> +} else {
> +throw new CommitFailedException(MERGE, 1, "Failed to 
> merge changes to the underlying store", e);
> +}
>  } catch (Exception e) {
>  throw new CommitFailedException(OAK, 1,
>  "Failed to merge changes to the underlying 
> store", e);
> {noformat}
> ...which causes the exception to surface immediately (see 
> https://issues.apache.org/jira/secure/attachment/12912117/OAK-7286.diff).
> (cc  [~mreutegg])



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (OAK-7286) DocumentNodeStoreBranch handling of non-recoverable DocumentStoreExceptions

2018-03-06 Thread Marcel Reutegger (JIRA)

 [ 
https://issues.apache.org/jira/browse/OAK-7286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marcel Reutegger updated OAK-7286:
--
Attachment: OAK-7286-DocumentStoreException.patch

> DocumentNodeStoreBranch handling of non-recoverable DocumentStoreExceptions
> ---
>
> Key: OAK-7286
> URL: https://issues.apache.org/jira/browse/OAK-7286
> Project: Jackrabbit Oak
>  Issue Type: Task
>  Components: documentmk
>Reporter: Julian Reschke
>Assignee: Marcel Reutegger
>Priority: Major
> Fix For: 1.9.0, 1.10
>
> Attachments: OAK-7286-DocumentStoreException.patch, 
> OAK-7286-DocumentStoreException.patch, OAK-7286.diff, OAK-7286.diff
>
>
> In {{DocumentNodeStoreBranch.merge()}}, any {{DocumentStoreException}} is 
> mapped to a {{DocumentStoreException}} to a {{CommitFailedException}} of type 
> "MERGE", which leads to the operation being retried, and a non-helpful 
> exception being generated.
> The effect can be observed by enabling a test in {{ValidNamesTest}}:
> {noformat}
> --- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java   
>   (Revision 1825371)
> +++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java   
>   (Arbeitskopie)
> @@ -300,7 +300,6 @@
>  public void testUnpairedHighSurrogateEnd() {
>  // see OAK-5506
>  
> org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("segment"));
> -
> org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("rdb"));
>  nameTest("foo" + SURROGATE_PAIR[0]);
>  }
> @@ -336,6 +335,7 @@
>  assertEquals("paths should be equal", p.getPath(), n.getPath());
>  return p;
>  } catch (RepositoryException ex) {
> +ex.printStackTrace();
>  fail(ex.getMessage());
>  return null;
>  }
> {noformat}
> The underlying issue is that {{RDBDocumentStore}} is throwing a 
> {{DocumentStoreException}} due to the invalid ID, and repeating the call will 
> not help.
> We probably should have a way to dinstinguish between different types of 
> problems.
> I hacked {{DocumentNodeStoreBranch}} like that:
> {noformat}
> --- 
> oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
> (Revision 1825371)
> +++ 
> oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
> (Arbeitskopie)
> @@ -520,8 +520,12 @@
>  } catch (ConflictException e) {
>  throw e.asCommitFailedException();
>  } catch(DocumentStoreException e) {
> -throw new CommitFailedException(MERGE, 1,
> -"Failed to merge changes to the underlying 
> store", e);
> +if (e.getMessage().contains("Invalid ID")) {
> +throw new CommitFailedException(OAK, 123,
> +"Failed to store changes in the underlying 
> store: " + e.getMessage(), e);
> +} else {
> +throw new CommitFailedException(MERGE, 1, "Failed to 
> merge changes to the underlying store", e);
> +}
>  } catch (Exception e) {
>  throw new CommitFailedException(OAK, 1,
>  "Failed to merge changes to the underlying 
> store", e);
> {noformat}
> ...which causes the exception to surface immediately (see 
> https://issues.apache.org/jira/secure/attachment/12912117/OAK-7286.diff).
> (cc  [~mreutegg])



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (OAK-7286) DocumentNodeStoreBranch handling of non-recoverable DocumentStoreExceptions

2018-03-06 Thread Marcel Reutegger (JIRA)

 [ 
https://issues.apache.org/jira/browse/OAK-7286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marcel Reutegger updated OAK-7286:
--
Attachment: OAK-7286-DocumentStoreException.patch

> DocumentNodeStoreBranch handling of non-recoverable DocumentStoreExceptions
> ---
>
> Key: OAK-7286
> URL: https://issues.apache.org/jira/browse/OAK-7286
> Project: Jackrabbit Oak
>  Issue Type: Task
>  Components: documentmk
>Reporter: Julian Reschke
>Assignee: Marcel Reutegger
>Priority: Major
> Fix For: 1.9.0, 1.10
>
> Attachments: OAK-7286-DocumentStoreException.patch, OAK-7286.diff, 
> OAK-7286.diff
>
>
> In {{DocumentNodeStoreBranch.merge()}}, any {{DocumentStoreException}} is 
> mapped to a {{DocumentStoreException}} to a {{CommitFailedException}} of type 
> "MERGE", which leads to the operation being retried, and a non-helpful 
> exception being generated.
> The effect can be observed by enabling a test in {{ValidNamesTest}}:
> {noformat}
> --- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java   
>   (Revision 1825371)
> +++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java   
>   (Arbeitskopie)
> @@ -300,7 +300,6 @@
>  public void testUnpairedHighSurrogateEnd() {
>  // see OAK-5506
>  
> org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("segment"));
> -
> org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("rdb"));
>  nameTest("foo" + SURROGATE_PAIR[0]);
>  }
> @@ -336,6 +335,7 @@
>  assertEquals("paths should be equal", p.getPath(), n.getPath());
>  return p;
>  } catch (RepositoryException ex) {
> +ex.printStackTrace();
>  fail(ex.getMessage());
>  return null;
>  }
> {noformat}
> The underlying issue is that {{RDBDocumentStore}} is throwing a 
> {{DocumentStoreException}} due to the invalid ID, and repeating the call will 
> not help.
> We probably should have a way to dinstinguish between different types of 
> problems.
> I hacked {{DocumentNodeStoreBranch}} like that:
> {noformat}
> --- 
> oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
> (Revision 1825371)
> +++ 
> oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
> (Arbeitskopie)
> @@ -520,8 +520,12 @@
>  } catch (ConflictException e) {
>  throw e.asCommitFailedException();
>  } catch(DocumentStoreException e) {
> -throw new CommitFailedException(MERGE, 1,
> -"Failed to merge changes to the underlying 
> store", e);
> +if (e.getMessage().contains("Invalid ID")) {
> +throw new CommitFailedException(OAK, 123,
> +"Failed to store changes in the underlying 
> store: " + e.getMessage(), e);
> +} else {
> +throw new CommitFailedException(MERGE, 1, "Failed to 
> merge changes to the underlying store", e);
> +}
>  } catch (Exception e) {
>  throw new CommitFailedException(OAK, 1,
>  "Failed to merge changes to the underlying 
> store", e);
> {noformat}
> ...which causes the exception to surface immediately (see 
> https://issues.apache.org/jira/secure/attachment/12912117/OAK-7286.diff).
> (cc  [~mreutegg])



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (OAK-7286) DocumentNodeStoreBranch handling of non-recoverable DocumentStoreExceptions

2018-02-28 Thread Julian Reschke (JIRA)

 [ 
https://issues.apache.org/jira/browse/OAK-7286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julian Reschke updated OAK-7286:

Attachment: OAK-7286.diff

> DocumentNodeStoreBranch handling of non-recoverable DocumentStoreExceptions
> ---
>
> Key: OAK-7286
> URL: https://issues.apache.org/jira/browse/OAK-7286
> Project: Jackrabbit Oak
>  Issue Type: Task
>  Components: documentmk
>Reporter: Julian Reschke
>Priority: Major
> Attachments: OAK-7286.diff, OAK-7286.diff
>
>
> In {{DocumentNodeStoreBranch.merge()}}, any {{DocumentStoreException}} is 
> mapped to a {{DocumentStoreException}} to a {{CommitFailedException}} of type 
> "MERGE", which leads to the operation being retried, and a non-helpful 
> exception being generated.
> The effect can be observed by enabling a test in {{ValidNamesTest}}:
> {noformat}
> --- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java   
>   (Revision 1825371)
> +++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java   
>   (Arbeitskopie)
> @@ -300,7 +300,6 @@
>  public void testUnpairedHighSurrogateEnd() {
>  // see OAK-5506
>  
> org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("segment"));
> -
> org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("rdb"));
>  nameTest("foo" + SURROGATE_PAIR[0]);
>  }
> @@ -336,6 +335,7 @@
>  assertEquals("paths should be equal", p.getPath(), n.getPath());
>  return p;
>  } catch (RepositoryException ex) {
> +ex.printStackTrace();
>  fail(ex.getMessage());
>  return null;
>  }
> {noformat}
> The underlying issue is that {{RDBDocumentStore}} is throwing a 
> {{DocumentStoreException}} due to the invalid ID, and repeating the call will 
> not help.
> We probably should have a way to dinstinguish between different types of 
> problems.
> I hacked {{DocumentNodeStoreBranch}} like that:
> {noformat}
> --- 
> oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
> (Revision 1825371)
> +++ 
> oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
> (Arbeitskopie)
> @@ -520,8 +520,12 @@
>  } catch (ConflictException e) {
>  throw e.asCommitFailedException();
>  } catch(DocumentStoreException e) {
> -throw new CommitFailedException(MERGE, 1,
> -"Failed to merge changes to the underlying 
> store", e);
> +if (e.getMessage().contains("Invalid ID")) {
> +throw new CommitFailedException(OAK, 123,
> +"Failed to store changes in the underlying 
> store: " + e.getMessage(), e);
> +} else {
> +throw new CommitFailedException(MERGE, 1, "Failed to 
> merge changes to the underlying store", e);
> +}
>  } catch (Exception e) {
>  throw new CommitFailedException(OAK, 1,
>  "Failed to merge changes to the underlying 
> store", e);
> {noformat}
> ...which causes the exception to surface immediately (see 
> https://issues.apache.org/jira/secure/attachment/12912117/OAK-7286.diff).
> (cc  [~mreutegg])



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (OAK-7286) DocumentNodeStoreBranch handling of non-recoverable DocumentStoreExceptions

2018-02-26 Thread Julian Reschke (JIRA)

 [ 
https://issues.apache.org/jira/browse/OAK-7286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julian Reschke updated OAK-7286:

Description: 
In {{DocumentNodeStoreBranch.merge()}}, any {{DocumentStoreException}} is 
mapped to a {{DocumentStoreException}} to a {{CommitFailedException}} of type 
"MERGE", which leads to the operation being retried, and a non-helpful 
exception being generated.

The effect can be observed by enabling a test in {{ValidNamesTest}}:

{noformat}
--- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java 
(Revision 1825371)
+++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java 
(Arbeitskopie)
@@ -300,7 +300,6 @@
 public void testUnpairedHighSurrogateEnd() {
 // see OAK-5506
 
org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("segment"));
-
org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("rdb"));
 nameTest("foo" + SURROGATE_PAIR[0]);
 }

@@ -336,6 +335,7 @@
 assertEquals("paths should be equal", p.getPath(), n.getPath());
 return p;
 } catch (RepositoryException ex) {
+ex.printStackTrace();
 fail(ex.getMessage());
 return null;
 }

{noformat}

The underlying issue is that {{RDBDocumentStore}} is throwing a 
{{DocumentStoreException}} due to the invalid ID, and repeating the call will 
not help.

We probably should have a way to dinstinguish between different types of 
problems.

I hacked {{DocumentNodeStoreBranch}} like that:

{noformat}
--- 
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
(Revision 1825371)
+++ 
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
(Arbeitskopie)
@@ -520,8 +520,12 @@
 } catch (ConflictException e) {
 throw e.asCommitFailedException();
 } catch(DocumentStoreException e) {
-throw new CommitFailedException(MERGE, 1,
-"Failed to merge changes to the underlying store", 
e);
+if (e.getMessage().contains("Invalid ID")) {
+throw new CommitFailedException(OAK, 123,
+"Failed to store changes in the underlying 
store: " + e.getMessage(), e);
+} else {
+throw new CommitFailedException(MERGE, 1, "Failed to 
merge changes to the underlying store", e);
+}
 } catch (Exception e) {
 throw new CommitFailedException(OAK, 1,
 "Failed to merge changes to the underlying store", 
e);

{noformat}

...which causes the exception to surface immediately (see 
https://issues.apache.org/jira/secure/attachment/12912117/OAK-7286.diff).

(cc  [~mreutegg])



  was:
In {{DocumentNodeStoreBranch.merge()}}, any {{DocumentStoreException}} is 
mapped to a {{DocumentStoreException}} to a {{CommitFailedException}} of type 
"MERGE", which leads to the operation being retried, and a non-helpful 
exception being generated.

The effect can be observed by enabling a test in {{ValidNamesTest}}:

{noformat}
--- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java 
(Revision 1825371)
+++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java 
(Arbeitskopie)
@@ -300,7 +300,6 @@
 public void testUnpairedHighSurrogateEnd() {
 // see OAK-5506
 
org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("segment"));
-
org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("rdb"));
 nameTest("foo" + SURROGATE_PAIR[0]);
 }

@@ -336,6 +335,7 @@
 assertEquals("paths should be equal", p.getPath(), n.getPath());
 return p;
 } catch (RepositoryException ex) {
+ex.printStackTrace();
 fail(ex.getMessage());
 return null;
 }

{noformat}

The underlying issue is that {{RDBDocumentStore}} is throwing a 
{{DocumentStoreException}} due to the invalid ID, and repeating the call will 
not help.

We probably should have a way to dinstinguish between different types of 
problems.

I hacked {{DocumentNodeStoreBranch}} like that:

{noformat}
--- 
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
(Revision 1825371)
+++ 
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
(Arbeitskopie)
@@ -520,8 +520,12 @@
 } catch (ConflictException e) {
 throw e.asCommitFailedException();
 } catch(DocumentStoreException e) {
-throw new 

[jira] [Updated] (OAK-7286) DocumentNodeStoreBranch handling of non-recoverable DocumentStoreExceptions

2018-02-26 Thread Julian Reschke (JIRA)

 [ 
https://issues.apache.org/jira/browse/OAK-7286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julian Reschke updated OAK-7286:

Description: 
In {{DocumentNodeStoreBranch.merge()}}, any {{DocumentStoreException}} is 
mapped to a {{DocumentStoreException}} to a {{CommitFailedException}} of type 
"MERGE", which leads to the operation being retried, and a non-helpful 
exception being generated.

The effect can be observed by enabling a test in {{ValidNamesTest}}:

{noformat}
--- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java 
(Revision 1825371)
+++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java 
(Arbeitskopie)
@@ -300,7 +300,6 @@
 public void testUnpairedHighSurrogateEnd() {
 // see OAK-5506
 
org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("segment"));
-
org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("rdb"));
 nameTest("foo" + SURROGATE_PAIR[0]);
 }

@@ -336,6 +335,7 @@
 assertEquals("paths should be equal", p.getPath(), n.getPath());
 return p;
 } catch (RepositoryException ex) {
+ex.printStackTrace();
 fail(ex.getMessage());
 return null;
 }

{noformat}

The underlying issue is that {{RDBDocumentStore}} is throwing a 
{{DocumentStoreException}} due to the invalid ID, and repeating the call will 
not help.

We probably should have a way to dinstinguish between different types of 
problems.

I hacked {{DocumentNodeStoreBranch}} like that:

{noformat}
--- 
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
(Revision 1825371)
+++ 
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
(Arbeitskopie)
@@ -520,8 +520,12 @@
 } catch (ConflictException e) {
 throw e.asCommitFailedException();
 } catch(DocumentStoreException e) {
-throw new CommitFailedException(MERGE, 1,
-"Failed to merge changes to the underlying store", 
e);
+if (e.getMessage().contains("Invalid ID")) {
+throw new CommitFailedException(OAK, 123,
+"Failed to store changes in the underlying 
store: " + e.getMessage(), e);
+} else {
+throw new CommitFailedException(MERGE, 1, "Failed to 
merge changes to the underlying store", e);
+}
 } catch (Exception e) {
 throw new CommitFailedException(OAK, 1,
 "Failed to merge changes to the underlying store", 
e);

{noformat}

...which causes the exception to surface immediately (see 
https://issues.apache.org/jira/secure/attachment/12912117/OAK-7286.diff).

(cc  [~mreutegg]])



  was:
In {{DocumentNodeStoreBranch.merge()}}, any {{DocumentStoreException}} is 
mapped to a {{DocumentStoreException}} to a {{CommitFailedException}} of type 
"MERGE", which leads to the operation being retried, and a non-helpful 
exception being generated.

The effect can be observed by enabling a test in {{ValidNamesTest}}:

{noformat}
--- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java 
(Revision 1825371)
+++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java 
(Arbeitskopie)
@@ -300,7 +300,6 @@
 public void testUnpairedHighSurrogateEnd() {
 // see OAK-5506
 
org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("segment"));
-
org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("rdb"));
 nameTest("foo" + SURROGATE_PAIR[0]);
 }

@@ -336,6 +335,7 @@
 assertEquals("paths should be equal", p.getPath(), n.getPath());
 return p;
 } catch (RepositoryException ex) {
+ex.printStackTrace();
 fail(ex.getMessage());
 return null;
 }

{noformat}

The underlying issue is that {{RDBDocumentStore}} is throwing a 
{{DocumentStoreException}} due to the invalid ID, and repeating the call will 
not help.

We probably should have a way to dinstinguish between different types of 
problems.

I hacked {{DocumentNodeStoreBranch}} like that:

{noformat}
--- 
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
(Revision 1825371)
+++ 
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
(Arbeitskopie)
@@ -520,8 +520,12 @@
 } catch (ConflictException e) {
 throw e.asCommitFailedException();
 } catch(DocumentStoreException e) {
-throw new 

[jira] [Updated] (OAK-7286) DocumentNodeStoreBranch handling of non-recoverable DocumentStoreExceptions

2018-02-26 Thread Julian Reschke (JIRA)

 [ 
https://issues.apache.org/jira/browse/OAK-7286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julian Reschke updated OAK-7286:

Attachment: OAK-7286.diff

> DocumentNodeStoreBranch handling of non-recoverable DocumentStoreExceptions
> ---
>
> Key: OAK-7286
> URL: https://issues.apache.org/jira/browse/OAK-7286
> Project: Jackrabbit Oak
>  Issue Type: Task
>  Components: documentmk
>Reporter: Julian Reschke
>Priority: Major
> Attachments: OAK-7286.diff
>
>
> In {{DocumentNodeStoreBranch.merge()}}, any {{DocumentStoreException}} is 
> mapped to a {{DocumentStoreException}} to a {{CommitFailedException}} of type 
> "MERGE", which leads to the operation being retried, and a non-helpful 
> exception being generated.
> The effect can be observed by enabling a test in {{ValidNamesTest}}:
> {noformat}
> --- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java   
>   (Revision 1825371)
> +++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ValidNamesTest.java   
>   (Arbeitskopie)
> @@ -300,7 +300,6 @@
>  public void testUnpairedHighSurrogateEnd() {
>  // see OAK-5506
>  
> org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("segment"));
> -
> org.junit.Assume.assumeFalse(super.fixture.toString().toLowerCase().contains("rdb"));
>  nameTest("foo" + SURROGATE_PAIR[0]);
>  }
> @@ -336,6 +335,7 @@
>  assertEquals("paths should be equal", p.getPath(), n.getPath());
>  return p;
>  } catch (RepositoryException ex) {
> +ex.printStackTrace();
>  fail(ex.getMessage());
>  return null;
>  }
> {noformat}
> The underlying issue is that {{RDBDocumentStore}} is throwing a 
> {{DocumentStoreException}} due to the invalid ID, and repeating the call will 
> not help.
> We probably should have a way to dinstinguish between different types of 
> problems.
> I hacked {{DocumentNodeStoreBranch}} like that:
> {noformat}
> --- 
> oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
> (Revision 1825371)
> +++ 
> oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
> (Arbeitskopie)
> @@ -520,8 +520,12 @@
>  } catch (ConflictException e) {
>  throw e.asCommitFailedException();
>  } catch(DocumentStoreException e) {
> -throw new CommitFailedException(MERGE, 1,
> -"Failed to merge changes to the underlying 
> store", e);
> +if (e.getMessage().contains("Invalid ID")) {
> +throw new CommitFailedException(OAK, 123,
> +"Failed to store changes in the underlying 
> store: " + e.getMessage(), e);
> +} else {
> +throw new CommitFailedException(MERGE, 1, "Failed to 
> merge changes to the underlying store", e);
> +}
>  } catch (Exception e) {
>  throw new CommitFailedException(OAK, 1,
>  "Failed to merge changes to the underlying 
> store", e);
> {noformat}
> ...which causes the exception to surface immediately.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)