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

Julian Reschke commented on OAK-12128:
--------------------------------------

BTW; with the code change we have two tests failing due to unexpected exception 
messages; will have a look:

[ERROR] 
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBackgroundUpdateTest.delayedRootDocumentUpdate
 -- Time elapsed: 0.012 s <<< FAILURE!
java.lang.AssertionError:

Expected: a string containing "concurrent update"
     but: was "This oak instance failed to update the lease in time and can 
therefore no longer access this DocumentNodeStore. (mode: STRICT, leaseEndTime: 
1772786304671 (2026-03-06T08:38:24.671Z), leaseTime: 120000, 
leaseFailureMargin: 20000, lease check end time (leaseEndTime - 
leaseFailureMargin): 1772786284671 (2026-03-06T08:38:04.671Z), now: 
1772786304904 (2026-03-06T08:38:24.904Z), remaining: -20233) Need to stop 
oak-store-document/DocumentNodeStoreService."
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
        at org.junit.Assert.assertThat(Assert.java:964)
        at org.junit.Assert.assertThat(Assert.java:930)
        at 
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBackgroundUpdateTest$2.run(DocumentNodeStoreBackgroundUpdateTest.java:112)
        at java.base/java.lang.Thread.run(Thread.java:842)

and

[ERROR] Tests run: 108, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 9.261 
s <<< FAILURE! -- in 
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreTest
[ERROR] 
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreTest.preventCommitPastLeaseEnd
 -- Time elapsed: 0.005 s <<< FAILURE!
java.lang.AssertionError:

Expected: a string containing "lease end"
     but: was "OakOak0001: This oak instance failed to update the lease in time 
and can therefore no longer access this DocumentNodeStore. (mode: STRICT, 
leaseEndTime: 120004 (1970-01-01T00:02:00.004Z), leaseTime: 120000, 
leaseFailureMargin: 20000, lease check end time (leaseEndTime - 
leaseFailureMargin): 100004 (1970-01-01T00:01:40.004Z), now: 120076 
(1970-01-01T00:02:00.076Z), remaining: -20072) Need to stop 
oak-store-document/DocumentNodeStoreService."
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
        at 
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreTest.preventCommitPastLeaseEnd(DocumentNodeStoreTest.java:3996)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)


> Fail earlier (and add more diags) when detecting late writes
> ------------------------------------------------------------
>
>                 Key: OAK-12128
>                 URL: https://issues.apache.org/jira/browse/OAK-12128
>             Project: Jackrabbit Oak
>          Issue Type: Task
>          Components: documentmk
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>            Priority: Major
>
> While discussing late write with [~stefanegli] we realized that late writes 
> (or at least some of them) can actually be detected in 
> LeaseCheckDocumentStoreWrapper - if a write call starts *before* lease end  
> and completes *after* lease end, it is (likely?) a late write and we can 
> either make it fail, or at least log it.
> Q1: does this make sense at all?
> Q2: exception? log? both?
> Q3: write operations or all?
> Q4: add more details to exception? (like method invoked - however stack trace 
> will tell us anyway)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to