blazingmq icon indicating copy to clipboard operation
blazingmq copied to clipboard

Fix[MQB]: app refcount is numVirtualStorages

Open dorjesinpo opened this issue 1 year ago • 0 comments

The race:

  1. Domain is being reconfigured with one less app
  2. Domain saves the new config as d_config before proceeding with updating Apps (in Cluster thread)
  3. PUT arrives and picks the "reduced" count but the storage for the App being removed is not removed yet. Queue inserts the PUT into the App storage that is about to be removed. (In queue thread)
  4. Queue thread starts unregistering the App and as the result decrements the PUT refCount. Now, the count is one less than the number of Apps (N)
  5. N - 1 Confirms arrive (where N is the number of Apps after reconfiguration).
  6. refCount drops to zero because it is off by 1.
  7. Queue attempts to remove the PUT but there is still Nth storage without confirm. And this asserts

this can manifest the other way - when we add new App

dorjesinpo avatar Sep 30 '24 15:09 dorjesinpo