Skip to content

Commit 243c9ab

Browse files
mbaedkereschke
andauthored
OAK-11284: Greedy Reuse of cluster IDs may lead to synchronous LastRe… (#1948)
Added documentation. --------- Co-authored-by: Julian Reschke <reschke@apache.org>
1 parent a8a14e9 commit 243c9ab

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

oak-doc/src/site/markdown/nodestore/documentmk.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,24 @@ the `machine` and `instance` fields. This behaviour is new and was introduced
773773
with Oak 1.10. Previous versions ignore entries that do not match the
774774
environment and would create a new entry.
775775

776+
Note that while this behavior is usually beneficial, there are circumstances
777+
under which it may lead to very slow startup times for cluster nodes that try
778+
to acquire a node ID that has not been shut down gracefully and has been
779+
inactive for a long time. This is due to synchronous recovery operations that
780+
are necessary to guarantee the consistency of the cluster (for details see
781+
[Recovery for a cluster node ID](#recovery-for-a-cluster-node-id)).
782+
783+
To avoid that, the maximum duration of the synchronous recovery may be
784+
limited using the system property `oak.documentMK.syncRecoveryTimeoutMillis`.
785+
A positive value will specify this maximum duration in milliseconds, while a
786+
negative value doesn't limit the recovery time. The default is `-1`.
787+
If the duration is exceeded, the node will no longer try to reuse the ID
788+
and pick one that doesn't need recovery.
789+
790+
Note that this feature has been specifically designed for unusual Oak
791+
deployments (requiring significantly longer lease timeouts) and is not
792+
recommended for general use.
793+
776794
### <a name="update-lease-for-a-cluster-node-id"></a> Update lease for a cluster node ID
777795

778796
Each running cluster node updates the `leaseEnd` time of the cluster node ID

oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevRecoveryAgent.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ public class LastRevRecoveryAgent {
8181

8282
private final Consumer<Integer> afterRecovery;
8383

84+
//OAK-11284: optionally limit the maximum duration of a synchronous recovery operation that may occur when
85+
//inactive node IDs are reused.
8486
private static final long SYNC_RECOVERY_TIMEOUT_MILLIS =
8587
SystemPropertySupplier
8688
.create("oak.documentMK.syncRecoveryTimeoutMillis", -1)

0 commit comments

Comments
 (0)