Uploaded image for project: 'Apache Curator'
  1. Apache Curator
  2. CURATOR-447

TreeCache: Improve memory usage and concurrent update logic

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.0, 2.12.0, 4.0.1
    • Fix Version/s: 4.1.0
    • Component/s: Recipes

      Description

      Jira https://issues.apache.org/jira/browse/CURATOR-374 reduced per-node memory usage in TreeCache. It can be improved further via removal of the nodeState field - its LIVE state corresponds exactly to the adjacent childData field being non-null, and a sentinel ChildData value can be used for the DEAD state. This simplification also reduces the room for bugs and state inconsistencies.

      Other improvements included:

      • A further simplification to have TreeNode extend AtomicReference, which obviates the need for an explicit childData field
      • More robust cache update logic (in get-children and get-data event callbacks)
      • Avoid overhead of incrementing/decrementing the outstandingOps atomic integer post-initialization

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                nickhill Nick Hill
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: