blazingmq
blazingmq copied to clipboard
Fix[MQB]: app refcount is numVirtualStorages
The race:
- Domain is being reconfigured with one less app
- Domain saves the new config as
d_configbefore proceeding with updating Apps (in Cluster thread) - 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)
- 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) -
N - 1Confirms arrive (whereNis the number of Apps after reconfiguration). - refCount drops to zero because it is off by
1. - 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