accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Elser (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ACCUMULO-2743) Improve stale-reads with ZooKeeper-backed data
Date Mon, 28 Apr 2014 17:50:22 GMT

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

Josh Elser commented on ACCUMULO-2743:
--------------------------------------

The easiest approach that doesn't involve touching a bunch of other code would be to add some
new methods on the API which can work around this. Since things like setting an iterator can
present stale data to both the client or the server, we could implement something that invalidates
the local cache to force a fresh read. This would not be very scalable though.

To solve the issue for clients, we could add a boolean option to bypass the cache and force
a read from zookeeper, but this has the downside of lots of new API methods which have that
extra boolean argument.

Neither of these seem ideal, but I'm not coming up with something that is, either.

> Improve stale-reads with ZooKeeper-backed data
> ----------------------------------------------
>
>                 Key: ACCUMULO-2743
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-2743
>             Project: Accumulo
>          Issue Type: Improvement
>            Reporter: Josh Elser
>             Fix For: 1.7.0
>
>
> Writing test code against Accumulo, especially via MiniAccumuloCluster, can be extremely
frustrating. ZooKeeper is used for managing table configurations, among other things, to allow
all tabletservers to be aware of the state of a table.
> The problem is that each tabletserver uses a Watcher to see when updates occur, and then
it updates an internal cache of these properties. This is a problem even on an instance with
a single tserver when setting a table property (configuring an iterator is a good example).
The setTableProperty command is implemented via the Master, not a tserver like fetching the
table configuration is implemented, which means that you're racing against the Watcher in
the tserver.
> The cause of this is that test code gets riddled with code like the following:
> {code}
> String myProperty = tableConfiguration.getProperty("myProperty");
> for (int i = 0; i < retries && null == myProperty; i++) {
>   myProperty = tableConfiguration.getProperty("myProperty");
>   Thread.sleep(some_millis);
> }
> // Hope that you actually saw the update
> Assert.assertNotNull(myProperty)
> {code}



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

Mime
View raw message