STR: 1) Create a new forum in the admin. 2) Create a new thread. 3) Delete the thread. Expected: Forum is empty. Actual: Forum is gone! Ricky, you figured this out when there was another deleting issue so I'm hoping this has a similar fix.
Looks like deleting the last post also causes this.
This only happens in the Master/Slave database scenario. Once the pinning db router lands, I think this will be fixed. We need to make sure that the router pins all reads on the initial POST in addition to requests after (within X seconds). Django has this feature that you can't turn off: "When Django deletes an object, it emulates the behavior of the SQL constraint ON DELETE CASCADE -- in other words, any objects which had foreign keys pointing at the object to be deleted will be deleted along with it." We need to make sure that the reads it makes for this behavior are all pinned to the master through the db router.
Same fix as bug 572930
Verified in support-stage-new, deleting threads and posts.