You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/09/01 17:43:01 UTC

[GitHub] [pulsar] merlimat opened a new pull request #11885: Fixed ResourceLockTest.revalidateLockOnDifferentSession()

merlimat opened a new pull request #11885:
URL: https://github.com/apache/pulsar/pull/11885


   ### Motivation
   
   Fixes #11690 
   
   The main issue in the test is that there are 2 `ResourceLock` instances that are competing.
   
    * `RL_1` acquires the lock
    * `RL_2` tries to “steal” the lock
    * When `RL_2` deletes the existing lock, `RL_1` might get the notification fast and delete the lock after `RL_2` did acquire it.
   
   That eventually lead in both locks getting expired:
   
   ```
   10:22:34.784 INFO  [main] o.a.p.m.c.i.ResourceLockImpl@68 - CREATED RESOURCE LOCK [RL 1 ]  - 
   10:22:34.807 INFO  [metadata-store-9-1] o.a.p.m.c.i.ResourceLockImpl@184 - [RL 1 ]  - Acquired resource lock on /key-193314812191875
   ----------------------- START --------------------
   10:22:34.807 INFO  [main] o.a.p.m.c.i.ResourceLockImpl@68 - CREATED RESOURCE LOCK [RL 2 ]  - 
   10:22:34.831 WARN  [metadata-store-11-1] o.a.p.m.c.i.ResourceLockImpl@149 - [RL 2 ] FAILED TO ACQUIRE LOCK WITH NO REVALIDATION: 
   10:22:34.833 WARN  [metadata-store-11-1] o.a.p.m.c.i.ResourceLockImpl@151 - [RL 2 ] REVALIDATING LOCK 
   10:22:34.837 INFO  [metadata-store-11-1] o.a.p.m.c.i.ResourceLockImpl@253 - [RL 2 ]  - Deleting stale lock at /key-193314812191875
   10:22:34.862 INFO  [metadata-store-9-1] o.a.p.m.c.i.ResourceLockImpl@205 -  [RL 1 ]  - Lock on resource /key-193314812191875 was invalidated
   10:22:34.884 INFO  [metadata-store-11-1] o.a.p.m.c.i.ResourceLockImpl@184 - [RL 2 ]  - Acquired resource lock on /key-193314812191875
   10:22:34.884 INFO  [metadata-store-11-1] o.a.p.m.c.i.ResourceLockImpl@258 - [RL 2 ]  - Successfully re-acquired stale lock at /key-193314812191875
   ----------------------- DONE --------------------
   10:22:34.885 INFO  [metadata-store-9-1] o.a.p.m.c.i.ResourceLockImpl@253 -  [RL 1 ]  - Deleting stale lock at /key-193314812191875
   10:22:34.912 INFO  [metadata-store-11-1] o.a.p.m.c.i.ResourceLockImpl@205 - [RL 2 ]  - Lock on resource /key-193314812191875 was invalidated
   10:22:34.912 INFO  [metadata-store-9-1] o.a.p.m.c.i.ResourceLockImpl@205 -  [RL 1 ]  - Lock on resource /key-193314812191875 was invalidated
   10:22:34.942 INFO  [metadata-store-9-1] o.a.p.m.c.i.ResourceLockImpl@184 -  [RL 1 ]  - Acquired resource lock on /key-193314812191875
   10:22:34.943 INFO  [metadata-store-9-1] o.a.p.m.c.i.ResourceLockImpl@258 -  [RL 1 ]  - Successfully re-acquired stale lock at /key-193314812191875
   10:22:34.943 INFO  [metadata-store-9-1] o.a.p.m.c.i.ResourceLockImpl@207 -  [RL 1 ]  - Successfully revalidated the lock on /key-193314812191875
   10:22:34.963 WARN  [metadata-store-9-1] o.a.p.m.c.i.ResourceLockImpl@210 -  [RL 1 ]  - Failed to revalidate the lock at /key-193314812191875. Marked as expired
   10:22:34.963 WARN  [metadata-store-11-1] o.a.p.m.c.i.ResourceLockImpl@210 - [RL 2 ]  - Failed to revalidate the lock at /key-193314812191875. Marked as expired
   ```
   
   ### Modification 
    * Avoid the competing ResourceLock instances. Instead simulate the case of existing lock left by previous broker instance.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] lhotari merged pull request #11885: Fixed ResourceLockTest.revalidateLockOnDifferentSession()

Posted by GitBox <gi...@apache.org>.
lhotari merged pull request #11885:
URL: https://github.com/apache/pulsar/pull/11885


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org