[jira] [Created] (OAK-8927) Build Jackrabbit Oak #2642 failed

2020-02-26 Thread Hudson (Jira)
Hudson created OAK-8927:
---

 Summary: Build Jackrabbit Oak #2642 failed
 Key: OAK-8927
 URL: https://issues.apache.org/jira/browse/OAK-8927
 Project: Jackrabbit Oak
  Issue Type: Bug
  Components: continuous integration
Reporter: Hudson


No description is provided

The build Jackrabbit Oak #2642 has failed.
First failed run: [Jackrabbit Oak 
#2642|https://builds.apache.org/job/Jackrabbit%20Oak/2642/] [console 
log|https://builds.apache.org/job/Jackrabbit%20Oak/2642/console]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OAK-8048) VersionHistory not removed when removing node and all its versions

2020-02-26 Thread Julian Reschke (Jira)


[ 
https://issues.apache.org/jira/browse/OAK-8048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17046253#comment-17046253
 ] 

Julian Reschke commented on OAK-8048:
-

I would say that this is an unexplored corner case of the spec. :)

Anyway, let's fix *this* first. So we should explore whether the code could 
cause harm; and that needs a test...

> VersionHistory not removed when removing node and all its versions
> --
>
> Key: OAK-8048
> URL: https://issues.apache.org/jira/browse/OAK-8048
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.8.9
>Reporter: Marco Piovesana
>Assignee: Julian Reschke
>Priority: Major
> Attachments: OAK-8048-test.diff, OAK-8048.diff, fix-OAK-8048.patch
>
>
> Hi all,
> I'm trying to delete a node and all its versions, but the version history is 
> not removed. I'm doing the following steps (as described in OAK-4370 and 
> JCR-134):
>  # retrieve the version history
>  # delete the node and save the session
>  # delete all versions except for the base version
>  # save the session
> The versions are all gone but the versionHistory node, and the base version 
> node, are still there. Am I doing something wrong? 
> The only test related to this that I found is 
> {{ReadOnlyVersionManagerTest.testRemoveEmptyHistoryAfterRemovingVersionable}}.
>  It does work, but uses Oak related classes and not the JCR interface.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OAK-8048) VersionHistory not removed when removing node and all its versions

2020-02-26 Thread Marcel Reutegger (Jira)


[ 
https://issues.apache.org/jira/browse/OAK-8048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17046252#comment-17046252
 ] 

Marcel Reutegger commented on OAK-8048:
---

bq. That said, child nodes of protected nodes are protected as well, yet we 
allow removing versions.

We do, but with an API call that's specifically designed for that purpose 
(VersionManager.removeVersion()). A Node.remove() won't work, because it is a 
transient operation. Almost all version related operations are workspace 
operations that automatically persist.

> VersionHistory not removed when removing node and all its versions
> --
>
> Key: OAK-8048
> URL: https://issues.apache.org/jira/browse/OAK-8048
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.8.9
>Reporter: Marco Piovesana
>Assignee: Julian Reschke
>Priority: Major
> Attachments: OAK-8048-test.diff, OAK-8048.diff, fix-OAK-8048.patch
>
>
> Hi all,
> I'm trying to delete a node and all its versions, but the version history is 
> not removed. I'm doing the following steps (as described in OAK-4370 and 
> JCR-134):
>  # retrieve the version history
>  # delete the node and save the session
>  # delete all versions except for the base version
>  # save the session
> The versions are all gone but the versionHistory node, and the base version 
> node, are still there. Am I doing something wrong? 
> The only test related to this that I found is 
> {{ReadOnlyVersionManagerTest.testRemoveEmptyHistoryAfterRemovingVersionable}}.
>  It does work, but uses Oak related classes and not the JCR interface.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OAK-8048) VersionHistory not removed when removing node and all its versions

2020-02-26 Thread Marcel Reutegger (Jira)


[ 
https://issues.apache.org/jira/browse/OAK-8048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17046249#comment-17046249
 ] 

Marcel Reutegger commented on OAK-8048:
---

I did not try this, but my thinking was:
- Create versionable node
- Checkpoint the versionable node
- Restore the versionable node to the root version
- Get the version history and remove the version

> VersionHistory not removed when removing node and all its versions
> --
>
> Key: OAK-8048
> URL: https://issues.apache.org/jira/browse/OAK-8048
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.8.9
>Reporter: Marco Piovesana
>Assignee: Julian Reschke
>Priority: Major
> Attachments: OAK-8048-test.diff, OAK-8048.diff, fix-OAK-8048.patch
>
>
> Hi all,
> I'm trying to delete a node and all its versions, but the version history is 
> not removed. I'm doing the following steps (as described in OAK-4370 and 
> JCR-134):
>  # retrieve the version history
>  # delete the node and save the session
>  # delete all versions except for the base version
>  # save the session
> The versions are all gone but the versionHistory node, and the base version 
> node, are still there. Am I doing something wrong? 
> The only test related to this that I found is 
> {{ReadOnlyVersionManagerTest.testRemoveEmptyHistoryAfterRemovingVersionable}}.
>  It does work, but uses Oak related classes and not the JCR interface.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OAK-8926) add RDBBlobStore performance test

2020-02-26 Thread Julian Reschke (Jira)


[ 
https://issues.apache.org/jira/browse/OAK-8926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17046179#comment-17046179
 ] 

Julian Reschke commented on OAK-8926:
-

trunk: [r1874555|http://svn.apache.org/r1874555]

> add RDBBlobStore performance test
> -
>
> Key: OAK-8926
> URL: https://issues.apache.org/jira/browse/OAK-8926
> Project: Jackrabbit Oak
>  Issue Type: Technical task
>  Components: rdbmk
>Reporter: Julian Reschke
>Assignee: Julian Reschke
>Priority: Minor
>  Labels: candidate_oak_1_22
> Fix For: 1.26.0
>
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (OAK-8926) add RDBBlobStore performance test

2020-02-26 Thread Julian Reschke (Jira)


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

Julian Reschke resolved OAK-8926.
-
Resolution: Fixed

> add RDBBlobStore performance test
> -
>
> Key: OAK-8926
> URL: https://issues.apache.org/jira/browse/OAK-8926
> Project: Jackrabbit Oak
>  Issue Type: Technical task
>  Components: rdbmk
>Reporter: Julian Reschke
>Assignee: Julian Reschke
>Priority: Minor
> Fix For: 1.26.0
>
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (OAK-8926) add RDBBlobStore performance test

2020-02-26 Thread Julian Reschke (Jira)


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

Julian Reschke updated OAK-8926:

Labels: candidate_oak_1_22  (was: )

> add RDBBlobStore performance test
> -
>
> Key: OAK-8926
> URL: https://issues.apache.org/jira/browse/OAK-8926
> Project: Jackrabbit Oak
>  Issue Type: Technical task
>  Components: rdbmk
>Reporter: Julian Reschke
>Assignee: Julian Reschke
>Priority: Minor
>  Labels: candidate_oak_1_22
> Fix For: 1.26.0
>
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (OAK-8926) add RDBBlobStore performance test

2020-02-26 Thread Julian Reschke (Jira)
Julian Reschke created OAK-8926:
---

 Summary: add RDBBlobStore performance test
 Key: OAK-8926
 URL: https://issues.apache.org/jira/browse/OAK-8926
 Project: Jackrabbit Oak
  Issue Type: Technical task
  Components: rdbmk
Reporter: Julian Reschke
Assignee: Julian Reschke
 Fix For: 1.26.0






--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OAK-8048) VersionHistory not removed when removing node and all its versions

2020-02-26 Thread Julian Reschke (Jira)


[ 
https://issues.apache.org/jira/browse/OAK-8048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17045737#comment-17045737
 ] 

Julian Reschke commented on OAK-8048:
-

{quote}I think that would violate the specification. The version history nodes 
are protected.
{quote}

 - maybe in Oak, but not requried by the spec. That said, child nodes of 
protected nodes are protected as well, yet we allow removing versions.
{quote}With the proposed patch, I'm wondering what happens when there is a 
versionable node with the root version as the base version. Wouldn't the code 
remove the version history when the last non-root version is removed?
{quote}
Funny you mention that. I tried to do that in a test, but couldn't come up with 
a way to have a non-empty version history where the base version is the root 
version. Do have something in mind how to get there?

> VersionHistory not removed when removing node and all its versions
> --
>
> Key: OAK-8048
> URL: https://issues.apache.org/jira/browse/OAK-8048
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.8.9
>Reporter: Marco Piovesana
>Assignee: Julian Reschke
>Priority: Major
> Attachments: OAK-8048-test.diff, OAK-8048.diff, fix-OAK-8048.patch
>
>
> Hi all,
> I'm trying to delete a node and all its versions, but the version history is 
> not removed. I'm doing the following steps (as described in OAK-4370 and 
> JCR-134):
>  # retrieve the version history
>  # delete the node and save the session
>  # delete all versions except for the base version
>  # save the session
> The versions are all gone but the versionHistory node, and the base version 
> node, are still there. Am I doing something wrong? 
> The only test related to this that I found is 
> {{ReadOnlyVersionManagerTest.testRemoveEmptyHistoryAfterRemovingVersionable}}.
>  It does work, but uses Oak related classes and not the JCR interface.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Comment Edited] (OAK-8917) Thousands ConflitException on .createRepository()

2020-02-26 Thread Olivier Jolit (Jira)


[ 
https://issues.apache.org/jira/browse/OAK-8917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17045679#comment-17045679
 ] 

Olivier Jolit edited comment on OAK-8917 at 2/26/20 4:35 PM:
-

Hello,

I did indeed reproduce without my custom security provider, I reproduce with 
the {{OpenSecurityProvider}}.

I actually wrote a main that reproduces this behavior quite simply. I give it 
below with the [^effective-pom.xml]and the [^output] attached.

The only notable thing is that I maven-shade commons-io and guava because of 
dependency conflicts with the other dependencies in other modules.
{code:java}
import org.apache.jackrabbit.api.JackrabbitRepository;
import org.apache.jackrabbit.oak.Oak;
import org.apache.jackrabbit.oak.jcr.Jcr;
import org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore;
import org.apache.jackrabbit.oak.plugins.document.rdb.RDBDataSourceFactory;
import 
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentNodeStoreBuilder;
import org.apache.jackrabbit.oak.spi.commit.ThreeWayConflictHandler;
import org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider;
import org.apache.jackrabbit.oak.spi.security.SecurityProvider;
import org.apache.jackrabbit.oak.spi.state.NodeStore;

import javax.jcr.Repository;

public class CreateRepositoryConflicts {

public static final String host = "xxx";
public static final String db = "xxx";
public static final String password = "xxx";
public static final String port = "xxx";

private static Repository repository;
private static NodeStore nodeStore;


public static void main(String[] args) {
System.out.println("Creating OAK repository first time");
createRepository();
shutdown();
System.out.println("Creating OAK repository second time");
createRepository();
shutdown();
}

public static void createRepository() {
String schema = "oak";
String user = "oak";
String sqlDriverClassName = "org.postgresql.Driver";
SecurityProvider openSecurityProvider = new OpenSecurityProvider();
nodeStore = RDBDocumentNodeStoreBuilder.newRDBDocumentNodeStoreBuilder()

.setRDBConnection(RDBDataSourceFactory.forJdbcUrl("jdbc:postgresql://" + host + 
":" + port + "/" + db + "?currentSchema= " + schema, user, password, 
sqlDriverClassName)).build();
repository = new Jcr(new 
Oak(nodeStore)).with(openSecurityProvider).createRepository();
}

public static void shutdown() {
if (repository instanceof JackrabbitRepository) {
System.out.println("Shutting down JCR...");
try {
((JackrabbitRepository) repository).shutdown();
} catch (Throwable e) {
System.out.println("Could not close JCR repo: " + 
e.getMessage());
e.printStackTrace();
}
}
if (nodeStore instanceof DocumentNodeStore) {
System.out.println("Disposing NodeStore...");
try {
((DocumentNodeStore) nodeStore).dispose();
} catch (Throwable e) {
System.out.println("Could not dispose NodeStore: " + 
e.getMessage());
e.printStackTrace();
}
}
}
}
{code}


was (Author: olivier.jolit):
Hello,

I did indeed reproduce without my custom security provider, I reproduce with 
the {{OpenSecurityProvider}}.

I actually wrote a main that reproduces this behavior quite simply. I give it 
below with the [^effective-pom.xml]and the [^output] attached.
{code:java}
import org.apache.jackrabbit.api.JackrabbitRepository;
import org.apache.jackrabbit.oak.Oak;
import org.apache.jackrabbit.oak.jcr.Jcr;
import org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore;
import org.apache.jackrabbit.oak.plugins.document.rdb.RDBDataSourceFactory;
import 
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentNodeStoreBuilder;
import org.apache.jackrabbit.oak.spi.commit.ThreeWayConflictHandler;
import org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider;
import org.apache.jackrabbit.oak.spi.security.SecurityProvider;
import org.apache.jackrabbit.oak.spi.state.NodeStore;

import javax.jcr.Repository;

public class CreateRepositoryConflicts {

public static final String host = "xxx";
public static final String db = "xxx";
public static final String password = "xxx";
public static final String port = "xxx";

private static Repository repository;
private static NodeStore nodeStore;


public static void main(String[] args) {
System.out.println("Creating OAK repository first time");
createRepository();
shutdown();
System.out.println("Creating OAK repository second time");
createRepository();
shutdown();
}

public static void createRepository() {
String schema = "oak";
String 

[jira] [Updated] (OAK-8917) Thousands ConflitException on .createRepository()

2020-02-26 Thread Olivier Jolit (Jira)


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

Olivier Jolit updated OAK-8917:
---
Attachment: output

> Thousands ConflitException on .createRepository()
> -
>
> Key: OAK-8917
> URL: https://issues.apache.org/jira/browse/OAK-8917
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.24.0
>Reporter: Olivier Jolit
>Priority: Minor
> Attachments: effective-pom.xml, output
>
>
> I use OAK in my Spring Boot application to store user content (bookmarks). 
> Users will write to OAK via REST calls.
> So I create a repository (in a Spring Bean) on my application startup with:
> {code:java}
> public OakBookmarkService() {
> RDBDocumentNodeStoreBuilder.newRDBDocumentNodeStoreBuilder()
> 
> .setRDBConnection(RDBDataSourceFactory.forJdbcUrl("jdbc:postgresql://" + host 
> + ":" + port + "/" + db + "?currentSchema= " + schema, user, password, 
> sqlDriverClassName)).build()
> SecurityProvider securityProvider = new 
> BookmarksSecurityProvider(rolesProvider);
> ThreeWayConflictHandler threeWayConflictHandler = new 
> BookmarkConflictHandler();
> repository = new Jcr(new 
> Oak(store)).with(securityProvider).with(threeWayConflictHandler).createRepository();
>  
> ...
> }{code}
> The issue I have is that this creation of the repository throws thousands of 
> ConflitExceptions like:
> {code:java}
> The node 1:/jcr:system already existed in revision
> r170631ac223-0-1 (older than base r17063a941e2-0-1), commit revision: 
> r17063a95314-0-1 {code}
> Which prevent my application from starting.
> Deleting all the tables in my PostgreSQL database between each startup of my 
> server fixes this issue but is obviously not expected. So it seems to me that 
> OAK tries to recreate the default nodes in the database even though they 
> already exist.
> I see in the documentation 
> ([https://jackrabbit.apache.org/oak/docs/construct.html]) that I need to 
> logout and dispose of the node store after each use. Do I have to do this 
> when the server stops ? How to ensure this is done even when the server 
> crashes in this case ?
> Or should I create the node store at the beginning of each REST call and 
> dispose of it at the end every time ? For now I only create a session and 
> close it for each call and am assuming creating the store each time is too 
> expensive.
> Also, my conflict handler (that always returns Resolution.OURS for now) does 
> not seem to be called in this scenario, which surprises me.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (OAK-8917) Thousands ConflitException on .createRepository()

2020-02-26 Thread Olivier Jolit (Jira)


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

Olivier Jolit updated OAK-8917:
---
Attachment: (was: output)

> Thousands ConflitException on .createRepository()
> -
>
> Key: OAK-8917
> URL: https://issues.apache.org/jira/browse/OAK-8917
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.24.0
>Reporter: Olivier Jolit
>Priority: Minor
> Attachments: effective-pom.xml
>
>
> I use OAK in my Spring Boot application to store user content (bookmarks). 
> Users will write to OAK via REST calls.
> So I create a repository (in a Spring Bean) on my application startup with:
> {code:java}
> public OakBookmarkService() {
> RDBDocumentNodeStoreBuilder.newRDBDocumentNodeStoreBuilder()
> 
> .setRDBConnection(RDBDataSourceFactory.forJdbcUrl("jdbc:postgresql://" + host 
> + ":" + port + "/" + db + "?currentSchema= " + schema, user, password, 
> sqlDriverClassName)).build()
> SecurityProvider securityProvider = new 
> BookmarksSecurityProvider(rolesProvider);
> ThreeWayConflictHandler threeWayConflictHandler = new 
> BookmarkConflictHandler();
> repository = new Jcr(new 
> Oak(store)).with(securityProvider).with(threeWayConflictHandler).createRepository();
>  
> ...
> }{code}
> The issue I have is that this creation of the repository throws thousands of 
> ConflitExceptions like:
> {code:java}
> The node 1:/jcr:system already existed in revision
> r170631ac223-0-1 (older than base r17063a941e2-0-1), commit revision: 
> r17063a95314-0-1 {code}
> Which prevent my application from starting.
> Deleting all the tables in my PostgreSQL database between each startup of my 
> server fixes this issue but is obviously not expected. So it seems to me that 
> OAK tries to recreate the default nodes in the database even though they 
> already exist.
> I see in the documentation 
> ([https://jackrabbit.apache.org/oak/docs/construct.html]) that I need to 
> logout and dispose of the node store after each use. Do I have to do this 
> when the server stops ? How to ensure this is done even when the server 
> crashes in this case ?
> Or should I create the node store at the beginning of each REST call and 
> dispose of it at the end every time ? For now I only create a session and 
> close it for each call and am assuming creating the store each time is too 
> expensive.
> Also, my conflict handler (that always returns Resolution.OURS for now) does 
> not seem to be called in this scenario, which surprises me.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OAK-8917) Thousands ConflitException on .createRepository()

2020-02-26 Thread Olivier Jolit (Jira)


[ 
https://issues.apache.org/jira/browse/OAK-8917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17045679#comment-17045679
 ] 

Olivier Jolit commented on OAK-8917:


Hello,

I did indeed reproduce without my custom security provider, I reproduce with 
the {{OpenSecurityProvider}}.

I actually wrote a main that reproduces this behavior quite simply. I give it 
below with the [^effective-pom.xml]and the [^output] attached.
{code:java}
import org.apache.jackrabbit.api.JackrabbitRepository;
import org.apache.jackrabbit.oak.Oak;
import org.apache.jackrabbit.oak.jcr.Jcr;
import org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore;
import org.apache.jackrabbit.oak.plugins.document.rdb.RDBDataSourceFactory;
import 
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentNodeStoreBuilder;
import org.apache.jackrabbit.oak.spi.commit.ThreeWayConflictHandler;
import org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider;
import org.apache.jackrabbit.oak.spi.security.SecurityProvider;
import org.apache.jackrabbit.oak.spi.state.NodeStore;

import javax.jcr.Repository;

public class CreateRepositoryConflicts {

public static final String host = "xxx";
public static final String db = "xxx";
public static final String password = "xxx";
public static final String port = "xxx";

private static Repository repository;
private static NodeStore nodeStore;


public static void main(String[] args) {
System.out.println("Creating OAK repository first time");
createRepository();
shutdown();
System.out.println("Creating OAK repository second time");
createRepository();
shutdown();
}

public static void createRepository() {
String schema = "oak";
String user = "oak";
String sqlDriverClassName = "org.postgresql.Driver";
SecurityProvider openSecurityProvider = new OpenSecurityProvider();
nodeStore = RDBDocumentNodeStoreBuilder.newRDBDocumentNodeStoreBuilder()

.setRDBConnection(RDBDataSourceFactory.forJdbcUrl("jdbc:postgresql://" + host + 
":" + port + "/" + db + "?currentSchema= " + schema, user, password, 
sqlDriverClassName)).build();
repository = new Jcr(new 
Oak(nodeStore)).with(openSecurityProvider).createRepository();
}

public static void shutdown() {
if (repository instanceof JackrabbitRepository) {
System.out.println("Shutting down JCR...");
try {
((JackrabbitRepository) repository).shutdown();
} catch (Throwable e) {
System.out.println("Could not close JCR repo: " + 
e.getMessage());
e.printStackTrace();
}
}
if (nodeStore instanceof DocumentNodeStore) {
System.out.println("Disposing NodeStore...");
try {
((DocumentNodeStore) nodeStore).dispose();
} catch (Throwable e) {
System.out.println("Could not dispose NodeStore: " + 
e.getMessage());
e.printStackTrace();
}
}
}
}
{code}

> Thousands ConflitException on .createRepository()
> -
>
> Key: OAK-8917
> URL: https://issues.apache.org/jira/browse/OAK-8917
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.24.0
>Reporter: Olivier Jolit
>Priority: Minor
> Attachments: effective-pom.xml, output
>
>
> I use OAK in my Spring Boot application to store user content (bookmarks). 
> Users will write to OAK via REST calls.
> So I create a repository (in a Spring Bean) on my application startup with:
> {code:java}
> public OakBookmarkService() {
> RDBDocumentNodeStoreBuilder.newRDBDocumentNodeStoreBuilder()
> 
> .setRDBConnection(RDBDataSourceFactory.forJdbcUrl("jdbc:postgresql://" + host 
> + ":" + port + "/" + db + "?currentSchema= " + schema, user, password, 
> sqlDriverClassName)).build()
> SecurityProvider securityProvider = new 
> BookmarksSecurityProvider(rolesProvider);
> ThreeWayConflictHandler threeWayConflictHandler = new 
> BookmarkConflictHandler();
> repository = new Jcr(new 
> Oak(store)).with(securityProvider).with(threeWayConflictHandler).createRepository();
>  
> ...
> }{code}
> The issue I have is that this creation of the repository throws thousands of 
> ConflitExceptions like:
> {code:java}
> The node 1:/jcr:system already existed in revision
> r170631ac223-0-1 (older than base r17063a941e2-0-1), commit revision: 
> r17063a95314-0-1 {code}
> Which prevent my application from starting.
> Deleting all the tables in my PostgreSQL database between each startup of my 
> server fixes this issue but is obviously not expected. So it seems to me that 
> OAK tries to recreate the default nodes in the database even though 

[jira] [Updated] (OAK-8917) Thousands ConflitException on .createRepository()

2020-02-26 Thread Olivier Jolit (Jira)


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

Olivier Jolit updated OAK-8917:
---
Attachment: effective-pom.xml

> Thousands ConflitException on .createRepository()
> -
>
> Key: OAK-8917
> URL: https://issues.apache.org/jira/browse/OAK-8917
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.24.0
>Reporter: Olivier Jolit
>Priority: Minor
> Attachments: effective-pom.xml, output
>
>
> I use OAK in my Spring Boot application to store user content (bookmarks). 
> Users will write to OAK via REST calls.
> So I create a repository (in a Spring Bean) on my application startup with:
> {code:java}
> public OakBookmarkService() {
> RDBDocumentNodeStoreBuilder.newRDBDocumentNodeStoreBuilder()
> 
> .setRDBConnection(RDBDataSourceFactory.forJdbcUrl("jdbc:postgresql://" + host 
> + ":" + port + "/" + db + "?currentSchema= " + schema, user, password, 
> sqlDriverClassName)).build()
> SecurityProvider securityProvider = new 
> BookmarksSecurityProvider(rolesProvider);
> ThreeWayConflictHandler threeWayConflictHandler = new 
> BookmarkConflictHandler();
> repository = new Jcr(new 
> Oak(store)).with(securityProvider).with(threeWayConflictHandler).createRepository();
>  
> ...
> }{code}
> The issue I have is that this creation of the repository throws thousands of 
> ConflitExceptions like:
> {code:java}
> The node 1:/jcr:system already existed in revision
> r170631ac223-0-1 (older than base r17063a941e2-0-1), commit revision: 
> r17063a95314-0-1 {code}
> Which prevent my application from starting.
> Deleting all the tables in my PostgreSQL database between each startup of my 
> server fixes this issue but is obviously not expected. So it seems to me that 
> OAK tries to recreate the default nodes in the database even though they 
> already exist.
> I see in the documentation 
> ([https://jackrabbit.apache.org/oak/docs/construct.html]) that I need to 
> logout and dispose of the node store after each use. Do I have to do this 
> when the server stops ? How to ensure this is done even when the server 
> crashes in this case ?
> Or should I create the node store at the beginning of each REST call and 
> dispose of it at the end every time ? For now I only create a session and 
> close it for each call and am assuming creating the store each time is too 
> expensive.
> Also, my conflict handler (that always returns Resolution.OURS for now) does 
> not seem to be called in this scenario, which surprises me.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (OAK-8917) Thousands ConflitException on .createRepository()

2020-02-26 Thread Olivier Jolit (Jira)


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

Olivier Jolit updated OAK-8917:
---
Attachment: output

> Thousands ConflitException on .createRepository()
> -
>
> Key: OAK-8917
> URL: https://issues.apache.org/jira/browse/OAK-8917
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.24.0
>Reporter: Olivier Jolit
>Priority: Minor
> Attachments: effective-pom.xml, output
>
>
> I use OAK in my Spring Boot application to store user content (bookmarks). 
> Users will write to OAK via REST calls.
> So I create a repository (in a Spring Bean) on my application startup with:
> {code:java}
> public OakBookmarkService() {
> RDBDocumentNodeStoreBuilder.newRDBDocumentNodeStoreBuilder()
> 
> .setRDBConnection(RDBDataSourceFactory.forJdbcUrl("jdbc:postgresql://" + host 
> + ":" + port + "/" + db + "?currentSchema= " + schema, user, password, 
> sqlDriverClassName)).build()
> SecurityProvider securityProvider = new 
> BookmarksSecurityProvider(rolesProvider);
> ThreeWayConflictHandler threeWayConflictHandler = new 
> BookmarkConflictHandler();
> repository = new Jcr(new 
> Oak(store)).with(securityProvider).with(threeWayConflictHandler).createRepository();
>  
> ...
> }{code}
> The issue I have is that this creation of the repository throws thousands of 
> ConflitExceptions like:
> {code:java}
> The node 1:/jcr:system already existed in revision
> r170631ac223-0-1 (older than base r17063a941e2-0-1), commit revision: 
> r17063a95314-0-1 {code}
> Which prevent my application from starting.
> Deleting all the tables in my PostgreSQL database between each startup of my 
> server fixes this issue but is obviously not expected. So it seems to me that 
> OAK tries to recreate the default nodes in the database even though they 
> already exist.
> I see in the documentation 
> ([https://jackrabbit.apache.org/oak/docs/construct.html]) that I need to 
> logout and dispose of the node store after each use. Do I have to do this 
> when the server stops ? How to ensure this is done even when the server 
> crashes in this case ?
> Or should I create the node store at the beginning of each REST call and 
> dispose of it at the end every time ? For now I only create a session and 
> close it for each call and am assuming creating the store each time is too 
> expensive.
> Also, my conflict handler (that always returns Resolution.OURS for now) does 
> not seem to be called in this scenario, which surprises me.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OAK-8917) Thousands ConflitException on .createRepository()

2020-02-26 Thread Marcel Reutegger (Jira)


[ 
https://issues.apache.org/jira/browse/OAK-8917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17045620#comment-17045620
 ] 

Marcel Reutegger commented on OAK-8917:
---

Do you see the same behaviour when you remove your application specific Oak 
components? E.g. just use the default security provider, etc. If you do, can 
you please provide sample code that reproduces the behaviour?

> Thousands ConflitException on .createRepository()
> -
>
> Key: OAK-8917
> URL: https://issues.apache.org/jira/browse/OAK-8917
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.24.0
>Reporter: Olivier Jolit
>Priority: Minor
>
> I use OAK in my Spring Boot application to store user content (bookmarks). 
> Users will write to OAK via REST calls.
> So I create a repository (in a Spring Bean) on my application startup with:
> {code:java}
> public OakBookmarkService() {
> RDBDocumentNodeStoreBuilder.newRDBDocumentNodeStoreBuilder()
> 
> .setRDBConnection(RDBDataSourceFactory.forJdbcUrl("jdbc:postgresql://" + host 
> + ":" + port + "/" + db + "?currentSchema= " + schema, user, password, 
> sqlDriverClassName)).build()
> SecurityProvider securityProvider = new 
> BookmarksSecurityProvider(rolesProvider);
> ThreeWayConflictHandler threeWayConflictHandler = new 
> BookmarkConflictHandler();
> repository = new Jcr(new 
> Oak(store)).with(securityProvider).with(threeWayConflictHandler).createRepository();
>  
> ...
> }{code}
> The issue I have is that this creation of the repository throws thousands of 
> ConflitExceptions like:
> {code:java}
> The node 1:/jcr:system already existed in revision
> r170631ac223-0-1 (older than base r17063a941e2-0-1), commit revision: 
> r17063a95314-0-1 {code}
> Which prevent my application from starting.
> Deleting all the tables in my PostgreSQL database between each startup of my 
> server fixes this issue but is obviously not expected. So it seems to me that 
> OAK tries to recreate the default nodes in the database even though they 
> already exist.
> I see in the documentation 
> ([https://jackrabbit.apache.org/oak/docs/construct.html]) that I need to 
> logout and dispose of the node store after each use. Do I have to do this 
> when the server stops ? How to ensure this is done even when the server 
> crashes in this case ?
> Or should I create the node store at the beginning of each REST call and 
> dispose of it at the end every time ? For now I only create a session and 
> close it for each call and am assuming creating the store each time is too 
> expensive.
> Also, my conflict handler (that always returns Resolution.OURS for now) does 
> not seem to be called in this scenario, which surprises me.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OAK-8923) Build Jackrabbit Oak #2640 failed

2020-02-26 Thread Hudson (Jira)


[ 
https://issues.apache.org/jira/browse/OAK-8923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17045613#comment-17045613
 ] 

Hudson commented on OAK-8923:
-

Previously failing build now is OK.
 Passed run: [Jackrabbit Oak 
#2641|https://builds.apache.org/job/Jackrabbit%20Oak/2641/] [console 
log|https://builds.apache.org/job/Jackrabbit%20Oak/2641/console]

> Build Jackrabbit Oak #2640 failed
> -
>
> Key: OAK-8923
> URL: https://issues.apache.org/jira/browse/OAK-8923
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: continuous integration
>Reporter: Hudson
>Priority: Major
>
> No description is provided
> The build Jackrabbit Oak #2640 has failed.
> First failed run: [Jackrabbit Oak 
> #2640|https://builds.apache.org/job/Jackrabbit%20Oak/2640/] [console 
> log|https://builds.apache.org/job/Jackrabbit%20Oak/2640/console]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OAK-8048) VersionHistory not removed when removing node and all its versions

2020-02-26 Thread Marcel Reutegger (Jira)


[ 
https://issues.apache.org/jira/browse/OAK-8048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17045608#comment-17045608
 ] 

Marcel Reutegger commented on OAK-8048:
---

bq. wouldn't it be clearer if we just allowed a remove operation on the 
VersionHistory node?

I think that would violate the specification. The version history nodes are 
protected.

bq. this (the implicit behavior) wouldn't help with cleaning up existing repos, 
right?

It won't clean the repository up automatically, but there is already an 
existing approach to trigger the logic in OrphanedVersionCleaner. Assuming 
there is an empty version history without a corresponding versionable node. 
Creating a versionable node with a UUID as recorded in the empty version 
history will link the new node to the empty version history. When the node is 
deleted, the OrphanedVersionCleaner will remove the empty version history as 
well.

With the proposed patch, I'm wondering what happens when there is a versionable 
node with the root version as the base version. Wouldn't the code remove the 
version history when the last non-root version is removed?

> VersionHistory not removed when removing node and all its versions
> --
>
> Key: OAK-8048
> URL: https://issues.apache.org/jira/browse/OAK-8048
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.8.9
>Reporter: Marco Piovesana
>Assignee: Julian Reschke
>Priority: Major
> Attachments: OAK-8048-test.diff, OAK-8048.diff, fix-OAK-8048.patch
>
>
> Hi all,
> I'm trying to delete a node and all its versions, but the version history is 
> not removed. I'm doing the following steps (as described in OAK-4370 and 
> JCR-134):
>  # retrieve the version history
>  # delete the node and save the session
>  # delete all versions except for the base version
>  # save the session
> The versions are all gone but the versionHistory node, and the base version 
> node, are still there. Am I doing something wrong? 
> The only test related to this that I found is 
> {{ReadOnlyVersionManagerTest.testRemoveEmptyHistoryAfterRemovingVersionable}}.
>  It does work, but uses Oak related classes and not the JCR interface.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OAK-8048) VersionHistory not removed when removing node and all its versions

2020-02-26 Thread Marcel Reutegger (Jira)


[ 
https://issues.apache.org/jira/browse/OAK-8048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17045592#comment-17045592
 ] 

Marcel Reutegger commented on OAK-8048:
---

bq. can you do a sanity check that this tests the right thing?

Yes, the test looks good to me.

> VersionHistory not removed when removing node and all its versions
> --
>
> Key: OAK-8048
> URL: https://issues.apache.org/jira/browse/OAK-8048
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.8.9
>Reporter: Marco Piovesana
>Assignee: Julian Reschke
>Priority: Major
> Attachments: OAK-8048-test.diff, OAK-8048.diff, fix-OAK-8048.patch
>
>
> Hi all,
> I'm trying to delete a node and all its versions, but the version history is 
> not removed. I'm doing the following steps (as described in OAK-4370 and 
> JCR-134):
>  # retrieve the version history
>  # delete the node and save the session
>  # delete all versions except for the base version
>  # save the session
> The versions are all gone but the versionHistory node, and the base version 
> node, are still there. Am I doing something wrong? 
> The only test related to this that I found is 
> {{ReadOnlyVersionManagerTest.testRemoveEmptyHistoryAfterRemovingVersionable}}.
>  It does work, but uses Oak related classes and not the JCR interface.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OAK-8925) RDBDocumentStore: for SQL Server stats, include type_desc and fill_factor

2020-02-26 Thread Julian Reschke (Jira)


[ 
https://issues.apache.org/jira/browse/OAK-8925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17045539#comment-17045539
 ] 

Julian Reschke commented on OAK-8925:
-

trunk: [r1874543|http://svn.apache.org/r1874543]

> RDBDocumentStore: for SQL Server stats, include type_desc and fill_factor
> -
>
> Key: OAK-8925
> URL: https://issues.apache.org/jira/browse/OAK-8925
> Project: Jackrabbit Oak
>  Issue Type: Technical task
>  Components: rdbmk
>Reporter: Julian Reschke
>Assignee: Julian Reschke
>Priority: Minor
>  Labels: candidate_oak_1_22
> Fix For: 1.26.0
>
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (OAK-8925) RDBDocumentStore: for SQL Server stats, include type_desc and fill_factor

2020-02-26 Thread Julian Reschke (Jira)


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

Julian Reschke resolved OAK-8925.
-
Resolution: Fixed

> RDBDocumentStore: for SQL Server stats, include type_desc and fill_factor
> -
>
> Key: OAK-8925
> URL: https://issues.apache.org/jira/browse/OAK-8925
> Project: Jackrabbit Oak
>  Issue Type: Technical task
>  Components: rdbmk
>Reporter: Julian Reschke
>Assignee: Julian Reschke
>Priority: Minor
> Fix For: 1.26.0
>
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (OAK-8925) RDBDocumentStore: for SQL Server stats, include type_desc and fill_factor

2020-02-26 Thread Julian Reschke (Jira)


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

Julian Reschke updated OAK-8925:

Labels: candidate_oak_1_22  (was: )

> RDBDocumentStore: for SQL Server stats, include type_desc and fill_factor
> -
>
> Key: OAK-8925
> URL: https://issues.apache.org/jira/browse/OAK-8925
> Project: Jackrabbit Oak
>  Issue Type: Technical task
>  Components: rdbmk
>Reporter: Julian Reschke
>Assignee: Julian Reschke
>Priority: Minor
>  Labels: candidate_oak_1_22
> Fix For: 1.26.0
>
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (OAK-8925) RDBDocumentStore: for SQL Server stats, include type_desc and fill_factor

2020-02-26 Thread Julian Reschke (Jira)
Julian Reschke created OAK-8925:
---

 Summary: RDBDocumentStore: for SQL Server stats, include type_desc 
and fill_factor
 Key: OAK-8925
 URL: https://issues.apache.org/jira/browse/OAK-8925
 Project: Jackrabbit Oak
  Issue Type: Technical task
  Components: rdbmk
Reporter: Julian Reschke
Assignee: Julian Reschke
 Fix For: 1.26.0






--
This message was sent by Atlassian Jira
(v8.3.4#803005)