Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-2714

Proposal for new api on Function interface

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • functions
    • None

    Description

      Function execution is the most useful feature of Geode. It allows you to execute a user-defined function on the node which holds the primary bucket of the partition region. In many cases application has colocated partition regions and using function application can operate on all the colocated primary buckets.

      In that function, the application makes sure that no other thread is operating on same colocated keys. But during bucket rebalance there is a possibility that two thread might be executing a function on the same set of keys on different nodes.

      It can happen as we don't take the lock(read-lock) on a primary bucket while executing the function. That allows Geode to move bucket for rebalancing.

      Proposal: Introduce the following api on Function interface to indicate the need to primariness.

      boolean acquirePrimaryBucketLock(); // name suggestion?

      The application would return true if they need a lock on the primary bucket. Default would be false.

      Geode would call the interface and try to take readLock before executing the function on that node. Otherwise, it will throw the exception and let app re-execute that function.

      Attachments

        Activity

          People

            Unassigned Unassigned
            hitesh.khamesra Hitesh Khamesra
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: