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 2020/06/25 05:35:17 UTC

[GitHub] [pulsar] merlimat opened a new pull request #7356: Fixed logic for forceful topic deletion

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


   ### Motivation
   
   In the topic deletion, during the removal of non-durable subscriptions, there is a race condition that leads to a state the topic cannot get deleted anymore, not even forcefully, until it gets unloaded/reloaded.
   
   The log trace is: 
   
   ```
   2020-06-20 00:00:23.763000+00:00 [WARN ] [.persistent.PersistentSubscription]  [persistent://TOPIC] [reader-15ab065c34] Failed to remove non durable cursor
   	org.apache.bookkeeper.mledger.ManagedLedgerException: ManagedCursor not found: reader-15ab065c34
   ```
   
   There are a couple of issues here: 
    1. The `isFenced` flag is only set after all producers/consumers are disconnected, but that won't prevent the from reconnecting.
    2. We're doing these 3 operations in steps: 
        1. Disconnecting the consumers
        2. Unsubscribing the subscription
        3. Deleting the topic
       
       The problem with (2) is that, for a non-durable subscription, the cursor is already deleted after (1), so the unsubscribing will fail there.
   3. When deleting the topic, all the cursors are going to get deleted when the managed ledger is deleted. There is no need to pre-delete all of them.
   4. Regarding `USAGE_COUNT_UPDATER`, if we're trying to force-delete operation, this operation should go through even if the counter is not correct. (eg: after the effects of #7355)
   5. Fixed one case in which `USAGE_COUNT_UPDATER` wasn't decremented after an error.
   
   


----------------------------------------------------------------
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.

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



[GitHub] [pulsar] merlimat merged pull request #7356: Fixed logic for forceful topic deletion

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


   


----------------------------------------------------------------
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.

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