[
https://issues.apache.org/jira/browse/OAK-3001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15669642#comment-15669642
]
Vikas Saurabh commented on OAK-3001:
------------------------------------
[~mreutegg], travis build failed after my last commit
[here|https://travis-ci.org/apache/jackrabbit-oak/builds/176271155]. While, I
think I've fixed the issue, but it seems that
{{JournalGCTest#gcWithCheckpoint}} isn't doing correct checks. I think we
should update that test as:
{noformat}
diff --git
a/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/JournalGCTest.java
b/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/JournalGCTest.java
index f518ab2..7c45cab 100644
---
a/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/JournalGCTest.java
+++
b/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/JournalGCTest.java
@@ -44,6 +44,8 @@ public class JournalGCTest {
DocumentNodeStore ns = builderProvider.newBuilder()
.clock(c).setAsyncDelay(0).getNodeStore();
+ Revision cpHead = ns.getHeadRevision().getRevision(ns.getClusterId());
+ assertNotNull(cpHead);
String cp = ns.checkpoint(TimeUnit.DAYS.toMillis(1));
// perform some change
NodeBuilder builder = ns.getRoot().builder();
@@ -55,7 +57,9 @@ public class JournalGCTest {
// trigger creation of journal entry
ns.runBackgroundOperations();
- JournalEntry entry = ns.getDocumentStore().find(JOURNAL,
JournalEntry.asId(head));
+ JournalEntry entry = ns.getDocumentStore().find(JOURNAL,
JournalEntry.asId(cpHead));
+ assertNotNull(entry);
+ entry = ns.getDocumentStore().find(JOURNAL, JournalEntry.asId(head));
assertNotNull(entry);
// wait two hours
@@ -65,6 +69,8 @@ public class JournalGCTest {
ns.getJournalGarbageCollector().gc(1, TimeUnit.HOURS, 10);
// must not remove existing entry, because checkpoint is still valid
+ entry = ns.getDocumentStore().find(JOURNAL, JournalEntry.asId(cpHead));
+ assertNotNull(entry);
entry = ns.getDocumentStore().find(JOURNAL, JournalEntry.asId(head));
assertNotNull(entry);
@@ -72,6 +78,8 @@ public class JournalGCTest {
ns.getJournalGarbageCollector().gc(1, TimeUnit.HOURS, 10);
// now journal GC can remove the entry
+ entry = ns.getDocumentStore().find(JOURNAL, JournalEntry.asId(cpHead));
+ assertNull(entry);
entry = ns.getDocumentStore().find(JOURNAL, JournalEntry.asId(head));
assertNull(entry);
}
{noformat}
> Simplify JournalGarbageCollector using a dedicated timestamp property
> ---------------------------------------------------------------------
>
> Key: OAK-3001
> URL: https://issues.apache.org/jira/browse/OAK-3001
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: core, mongomk
> Reporter: Stefan Egli
> Assignee: Vikas Saurabh
> Priority: Critical
> Labels: scalability
> Fix For: 1.6, 1.5.14
>
> Attachments: OAK-3001.take1.patch
>
>
> This subtask is about spawning out a
> [comment|https://issues.apache.org/jira/browse/OAK-2829?focusedCommentId=14585733&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14585733]
> from [~chetanm] re JournalGC:
> {quote}
> Further looking at JournalGarbageCollector ... it would be simpler if you
> record the journal entry timestamp as an attribute in JournalEntry document
> and then you can delete all the entries which are older than some time by a
> simple query. This would avoid fetching all the entries to be deleted on the
> Oak side
> {quote}
> and a corresponding
> [reply|https://issues.apache.org/jira/browse/OAK-2829?focusedCommentId=14585870&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14585870]
> from myself:
> {quote}
> Re querying by timestamp: that would indeed be simpler. With the current set
> of DocumentStore API however, I believe this is not possible. But:
> [DocumentStore.query|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentStore.java#L127]
> comes quite close: it would probably just require the opposite of that
> method too:
> {code}
> public <T extends Document> List<T> query(Collection<T> collection,
> String fromKey,
> String toKey,
> String indexedProperty,
> long endValue,
> int limit) {
> {code}
> .. or what about generalizing this method to have both a {{startValue}} and
> an {{endValue}} - with {{-1}} indicating when one of them is not used?
> {quote}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)