Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-2589 Create new client API
  3. ACCUMULO-2743

Improve stale-reads with ZooKeeper-backed data

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      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:

      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)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                elserj Josh Elser
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: