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 mr...@apache.org on 2017/04/24 12:53:22 UTC
svn commit: r1792471 - in /jackrabbit/oak/trunk:
oak-doc/src/site/markdown/nodestore/documentmk.md oak-run/README.md
Author: mreutegg
Date: Mon Apr 24 12:53:22 2017
New Revision: 1792471
URL: http://svn.apache.org/viewvc?rev=1792471&view=rev
Log:
OAK-5898: Revision GC command line tool
Add documentation
Modified:
jackrabbit/oak/trunk/oak-doc/src/site/markdown/nodestore/documentmk.md
jackrabbit/oak/trunk/oak-run/README.md
Modified: jackrabbit/oak/trunk/oak-doc/src/site/markdown/nodestore/documentmk.md
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-doc/src/site/markdown/nodestore/documentmk.md?rev=1792471&r1=1792470&r2=1792471&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-doc/src/site/markdown/nodestore/documentmk.md (original)
+++ jackrabbit/oak/trunk/oak-doc/src/site/markdown/nodestore/documentmk.md Mon Apr 24 12:53:22 2017
@@ -40,7 +40,8 @@
* [Caching](#cache)
* [Cache Invalidation](#cache-invalidation)
* [Cache Configuration](#cache-configuration)
- * [Unlock upgrade ](#unlockUpgrade)
+ * [Unlock upgrade](#unlockUpgrade)
+ * [Revision Garbage Collection](#revisionGC)
One of the plugins in Oak stores data in a document oriented format.
The plugin implements the low level `NodeStore` interface.
@@ -623,6 +624,51 @@ are inactive, otherwise the command will
Refer to [Secondary Store](document/secondary-store.html)
+## <a name="revision-gc"></a> Revision Garbage Collection
+
+As described in the section [Node Content Model](#node-content-model), the
+DocumentNodeStore does not overwrite existing data but adds it to an existing
+document when a property is updated. Cleaning up old data, which is not needed
+anymore is done with a process called `Revision Garbage Collection`. This
+process does not run automatically and must be triggered periodically by the
+application. The garbage collection process adds some pressure on the system,
+so the application should trigger it when it is most convenient. E.g. at night,
+when systems are usually not that busy. It is usually sufficient to run it once
+a day. There are several ways how the revision garbage collection can be
+triggered:
+
+* Call `startRevisionGC()` on the [RepositoryManagementMBean](http://jackrabbit.apache.org/oak/docs/apidocs/org/apache/jackrabbit/oak/api/jmx/RepositoryManagementMBean.html)
+* Call [gc()](http://jackrabbit.apache.org/oak/docs/apidocs/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.html#gc-long-java.util.concurrent.TimeUnit-) on the `VersionGarbageCollector` obtained from the `DocumentNodeStore` instance
+* Use the oak-run runnable jar file with the `revisions` run mode (`@since Oak 1.8`).
+
+The first two options are not described in more detail, because both of them
+are simple method calls. The third option comes with some sub commands as
+described below when oak-run with the `revisions` run mode is invoked without
+parameters or options:
+
+ revisions mongodb://host:port/database <sub-command> [options]
+ where sub-command is one of
+ info give information about the revisions state without performing
+ any modifications
+ collect perform garbage collection
+ reset clear all persisted metadata
+
+ Option Description
+ ------ -----------
+ -?, -h, --help show help
+ --cacheSize <Integer> cache size (default: 0)
+ --clusterId <Integer> MongoMK clusterId (default: 0)
+ --delay <Double> introduce delays to reduce impact on
+ system (default: 0.0)
+ --disableBranches disable branches
+ --limit <Integer> collect at most limit documents
+ (default: -1)
+ --olderThan <Long> collect only docs older than n seconds
+ (default: 86400)
+ --once only 1 iteration
+ --timeLimit <Long> cancel garbage collection after n
+ seconds (default: -1)
+
[1]: http://docs.mongodb.org/manual/core/read-preference/
[2]: http://docs.mongodb.org/manual/core/write-concern/
[3]: http://docs.mongodb.org/manual/reference/connection-string/#read-preference-options
Modified: jackrabbit/oak/trunk/oak-run/README.md
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/README.md?rev=1792471&r1=1792470&r2=1792471&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/README.md (original)
+++ jackrabbit/oak/trunk/oak-run/README.md Mon Apr 24 12:53:22 2017
@@ -21,6 +21,7 @@ The following runmodes are currently ava
* recovery : Run a _lastRev recovery on a MongoMK repository
* resetclusterid : Resets the cluster id
* restore : Restore a backup of an Oak repository.
+ * revisions : Revision GC on a DocumentMK
* server : Run the Oak Server.
* tarmkdiff : Show changes between revisions on TarMk
* tarmkrecovery : Lists candidates for head journal entries
@@ -528,6 +529,11 @@ Unlock DocumentMK upgrade
See the [official documentation](http://jackrabbit.apache.org/oak/docs/nodestore/documentmk.html#unlockUpgrade).
+Revisions
+---------
+
+See the [official documentation](http://jackrabbit.apache.org/oak/docs/nodestore/documentmk.html#revisionGC).
+
License
-------