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.
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.
Remove the following check that drives taking lock on local nodes:
And it will call:
Also remove the logic taking lock in individual nodes in: