hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stack (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-10714) SyncFuture hangs when sequence is 0
Date Mon, 10 Mar 2014 19:42:43 GMT

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

stack commented on HBASE-10714:
-------------------------------

Good on you [~jxiang]

Could this code be put into a method, hidden?  There is some duplication of code from replaceWriter:

{code}
+            SafePointZigZagLatch zigzagLatch = (ringBufferEventHandler == null)
+              ? null: ringBufferEventHandler.zigzagLatch;
+            if (zigzagLatch != null && !zigzagLatch.isCocked()) {
+              // Someone is replacing the writer now. To avoid racing with
+              // writer#close, let's wait till the writer is closed.
+              zigzagLatch.safePointReleasedLatch.await();
+            }
{code}

Also, since no locking going on, we could come out of the above and the sync could still fail
because its being swapped under us -- but that should be ok.. right.  We'll catch the IOE
and try a new log roll?

Thanks Jimmy for fixing holes in this stuff.

> SyncFuture hangs when sequence is 0
> -----------------------------------
>
>                 Key: HBASE-10714
>                 URL: https://issues.apache.org/jira/browse/HBASE-10714
>             Project: HBase
>          Issue Type: Bug
>          Components: wal
>            Reporter: Jimmy Xiang
>            Assignee: Jimmy Xiang
>             Fix For: 0.99.0
>
>         Attachments: hbase-10714.patch
>
>
> In SyncFuture, NOT_DONE = 0. The initial value of the ringBuffer is -1. So ringBuffer.next()
gives 0 for the first call. If we create a SyncFuture with sequence = 0, even when we set
it's done (ie. doneSequence = 0), it is still not done since doneSequence == NOT_DONE == 0.
 Can we set NOT_DONE to -1, and the initial doneSequence to -2?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message