[
https://issues.apache.org/jira/browse/GEODE-9132?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Anilkumar Gingade updated GEODE-9132:
-------------------------------------
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:
{code}
boolean acquireClearLockForNotification =
(partitionedRegion.hasAnyClientsInterested() ||
partitionedRegion.hasListener());
{code}
And it will call:
{code}
obtainLockForClear(regionEvent);
{code}
Also remove the logic taking lock in individual nodes in:
DistributedRegion.obtainWriteLocksForClear()
Remove:
if (!localLockedAlready) {
lockLocallyForClear(getDistributionManager(), getMyId(), regionEvent);
}
was:
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:
{code}
boolean acquireClearLockForNotification =
(partitionedRegion.hasAnyClientsInterested() ||
partitionedRegion.hasListener());
{code}
And it will call:
{code}
obtainLockForClear(regionEvent);
{Code}
Also remove the logic taking lock in individual nodes in:
DistributedRegion.obtainWriteLocksForClear()
Remove:
if (!localLockedAlready) {
lockLocallyForClear(getDistributionManager(), getMyId(), regionEvent);
}
> PR clear to take locks on all buckets unconditionally.
> ------------------------------------------------------
>
> Key: GEODE-9132
> URL: https://issues.apache.org/jira/browse/GEODE-9132
> Project: Geode
> Issue Type: Sub-task
> Components: regions
> Reporter: Anilkumar Gingade
> Priority: Major
>
> 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:
> {code}
> boolean acquireClearLockForNotification =
> (partitionedRegion.hasAnyClientsInterested() ||
> partitionedRegion.hasListener());
> {code}
> And it will call:
> {code}
> obtainLockForClear(regionEvent);
> {code}
> Also remove the logic taking lock in individual nodes in:
> DistributedRegion.obtainWriteLocksForClear()
> Remove:
> if (!localLockedAlready) {
> lockLocallyForClear(getDistributionManager(), getMyId(), regionEvent);
> }
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)