accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Turner (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (ACCUMULO-3954) TabletServer advertises existence before acquiring its lock
Date Wed, 12 Aug 2015 12:08:45 GMT

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

Keith Turner edited comment on ACCUMULO-3954 at 8/12/15 12:08 PM:
------------------------------------------------------------------

I looked at the code, it seems to be doing the right thing.  It calls  {{getChildren()}} for
each child at [InstanceOperationsImpl.java line 119|https://github.com/apache/accumulo/blob/1.6.3/core/src/main/java/org/apache/accumulo/core/client/impl/InstanceOperationsImpl.java#L119].
 That code is duplicating {{ZooLock.getLockData()}} and should probably just call  {{ZooLock.getLockData()}}.

bq.  If we get the lock before advertising our existence

The lock node should be the advertisement.   The code in {{InstanceOperationsImpl.getTabletServers()}}
seems to be reading the lock node.  I looked around in the tserver code for synchronization
issues where the tserver has created the lock node, but has not updated its internal memory
structures to reflect that.   I was looking in master.  The synchronziation seems ok.  In
{{announceExistence()}} it calls {{ZooLock.tryLock()}} which is synchronized and creates the
lock node.  This should be mutually exclusive with the call to {{tabletServerLock.wasLockAcquired()}}
in {{TabletServer.ThriftClientHandler.checkPermission()}}

One possibility is that something like the following is happening :

 1. Process A gets a list of tservers
 2. Tserver 1 is restarted on same port
 3. Process A contacts Tserver 1 while its starting up


was (Author: kturner):
I looked at the code, it does seems to be doing the right thing.  It calls  {{getChildren()}}
for each child at [InstanceOperationsImpl.java line 119|https://github.com/apache/accumulo/blob/1.6.3/core/src/main/java/org/apache/accumulo/core/client/impl/InstanceOperationsImpl.java#L119].
 That code is duplicating {{ZooLock.getLockData()}} and should probably just call  {{ZooLock.getLockData()}}.

bq.  If we get the lock before advertising our existence

The lock node should be the advertisement.   The code in {{InstanceOperationsImpl.getTabletServers()}}
seems to be reading the lock node.  I looked around in the tserver code for synchronization
issues where the tserver has created the lock node, but has not updated its internal memory
structures to reflect that.   I was looking in master.  The synchronziation seems ok.  In
{{announceExistence()}} it calls {{ZooLock.tryLock()}} which is synchronized and creates the
lock node.  This should be mutually exclusive with the call to {{tabletServerLock.wasLockAcquired()}}
in {{TabletServer.ThriftClientHandler.checkPermission()}}

One possibility is that something like the following is happening :

 1. Process A gets a list of tservers
 2. Tserver 1 is restarted on same port
 3. Process A contacts Tserver 1 while its starting up

> TabletServer advertises existence before acquiring its lock
> -----------------------------------------------------------
>
>                 Key: ACCUMULO-3954
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-3954
>             Project: Accumulo
>          Issue Type: Bug
>          Components: tserver
>    Affects Versions: 1.6.3, 1.7.0
>            Reporter: Josh Elser
>            Assignee: Josh Elser
>            Priority: Trivial
>             Fix For: 1.8.0
>
>
> Noticed this error today on the monitor after restarting Accumulo:
> {noformat}
> 2015-08-06 16:57:10,788 [tserver.TabletServer] WARN : tserver:hostname Got getScans message
from master before lock acquired, ignoring...
> 2015-08-06 16:57:10,791 [tserver.TabletServer$ThriftClientHandler] ERROR: tserver:jelser-phoenix-1.openstacklocal
Lock not acquired
> java.lang.RuntimeException: Lock not acquired
>         at org.apache.accumulo.tserver.TabletServer$ThriftClientHandler.checkPermission(TabletServer.java:1400)
>         at org.apache.accumulo.tserver.TabletServer$ThriftClientHandler.getActiveScans(TabletServer.java:1622)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:497)
>         at org.apache.accumulo.core.trace.wrappers.RpcServerInvocationHandler.invoke(RpcServerInvocationHandler.java:39)
>         at org.apache.accumulo.server.rpc.RpcWrapper$1.invoke(RpcWrapper.java:47)
>         at com.sun.proxy.$Proxy21.getActiveScans(Unknown Source)
>         at org.apache.accumulo.core.tabletserver.thrift.TabletClientService$Processor$getActiveScans.getResult(TabletClientService.java:2864)
>         at org.apache.accumulo.core.tabletserver.thrift.TabletClientService$Processor$getActiveScans.getResult(TabletClientService.java:2848)
>         at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
>         at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
>         at org.apache.accumulo.server.rpc.TimedProcessor.process(TimedProcessor.java:63)
>         at org.apache.thrift.server.AbstractNonblockingServer$FrameBuffer.invoke(AbstractNonblockingServer.java:516)
>         at org.apache.accumulo.server.rpc.CustomNonBlockingServer$1.run(CustomNonBlockingServer.java:78)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         at org.apache.accumulo.fate.util.LoggingRunnable.run(LoggingRunnable.java:35)
>         at java.lang.Thread.run(Thread.java:745)
> {noformat}
> I don't think this should be bubbling up to the monitor as an error. I believe it is
an entirely normal race condition that can happen. If the tabletserver is not ready to accept
an RPC, it can log a message at debug. The error condition would be a tabletserver never acquiring
its lock (and thus should be handled elsewhere).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message