Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-7665 Ability to clear a Partitioned Region
  3. GEODE-9132

PR clear to take locks on all buckets unconditionally.

    XMLWordPrintableJSON

    Details

      Description

      Existing behavior:
      PR clear employs two different locking behavior based on the presence of client subscription and cache-listeners. If there is no subscription or cache-listener it takes the bucket locks on local nodes else it will send a message to take locks on all buckets before doing the clear.

      Expected behavior:
      To keep the code/behavior simple PR clear to employ single locking behavior. It will take the lock on all buckets before doing clear irrespective of subscription or cache-listener presence.

      Solution:
      Remove the following check that drives taking lock on local nodes:

      boolean acquireClearLockForNotification =
                (partitionedRegion.hasAnyClientsInterested() || partitionedRegion.hasListener());
      

      And it will call:

      obtainLockForClear(regionEvent);
      

      Also remove the logic taking lock in individual nodes in:
      DistributedRegion.obtainWriteLocksForClear()
      Remove:
      if (!localLockedAlready)

      { lockLocallyForClear(getDistributionManager(), getMyId(), regionEvent); }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              agingade Anilkumar Gingade
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: