(2.5) Cockroach tables and Redis keys are not deleted when a project is deleted [2.5]
johnantonn opened this issue · comments
Since the organization info is stored in mongo and the actual data (event collections and properties) are stored in cockroach, upon a delete organization request, the router should not only delete the organization from mongo, but issue commands to delete its associated data from cockroach as well.
Redis keys will be deleted as well by doing the above, because their deletion is tied with the deletion of cockorach tables and columns.
Additional logic needs to be introduced for the cases where an event collection, say X, is deleted (it's renamed as deleted_X in cockroachdb) and then it's re-created and re-deleted. The second deletion won't succeed because there's already a deleted_X table in cockroach (unless of course the cleanup script has been executed in the meantime).
Count logic should be inserted to increment deleted tables from cockroach, e.g. deleted_X_1, deleted_X_2 etc.