You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Stefan Egli (JIRA)" <ji...@apache.org> on 2018/11/26 13:50:00 UTC

[jira] [Commented] (OAK-7869) Commit queue stuck when input stream of blob blocks

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

Stefan Egli commented on OAK-7869:
----------------------------------

Did a review and as per my understanding the changes look good to me. IIUC the core of the fix is that {{DocumentNodeStore.newTrunkCommit()}} was originally grabbing a revision with the commit queue and then building the commit. If that commit building would block, due to user's InputStream blocking, it would block any further commits. And with the fix this order is now inverted, ie the commit is built without having a revision yet, so it cannot block anymore. Branches are not affected by this bug as they already had this 'inverted order'.

The only minor thing that I'd like to bring up is in the test itself, in [{{DocumentNodeStoreIT.BlockingBlob.InputStream.read()}}|https://github.com/mreutegg/jackrabbit-oak/blob/403f0952dccd667e315090d8d426bae2f8866cb1/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreIT.java#L217]: shouldn't {{InputStream.read()}} _block until input data is available_ - ie it should be something like this:
{code:java}
    @Override
    public int read() {
        int b;
        while ( (b = readOrEnd() ) == 0) { /* blocking */ }
        return b;
    }
{code}
/cc [~mreutegg]

> Commit queue stuck when input stream of blob blocks
> ---------------------------------------------------
>
>                 Key: OAK-7869
>                 URL: https://issues.apache.org/jira/browse/OAK-7869
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: documentmk
>    Affects Versions: 1.0, 1.2, 1.4, 1.6.0, 1.8.0
>            Reporter: Marcel Reutegger
>            Assignee: Marcel Reutegger
>            Priority: Major
>             Fix For: 1.10
>
>
> This is the same scenario as described in OAK-7867 but for the DocumentNodeStore.
> The behaviour of the DocumentNodeStore is slightly different. The rogue InputStream will block the CommitQueue inside the DocumentNodeStore and prevent other commits from finishing. Other commits may proceed up to the point where changes are persisted, including the final update on the commit root document, but the merge calls for those commits will never return.
> It doesn't look like the issue can cause data loss, but can still affect availability of the system as other writes are blocked. Writes on other cluster nodes may also be affected because a blocked CommitQueue means already persisted commits are not propagated through the background update thread. Commits on other cluster nodes then may conflict because changes from the affected cluster node are not yet made visible.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)