Date: 2020-04-12
Accepted (lazy consensus) & implemented
Cassandra is used within distributed James product to hold messages and mailboxes metadata.
Cassandra holds the following tables:
Currently, the deletion only deletes the first level of metadata. Lower level metadata stay unreachable. The data looks deleted but references are actually still present.
Concretely:
This jeopardize efforts to regain disk space and privacy, for example through blobStore garbage collection.
We need to cleanup Cassandra metadata. They can be retrieved from dandling metadata after the delete operation had been conducted out. We need to delete the lower levels first so that upon failures undeleted metadata can still be reached.
This cleanup is not needed for strict correctness from a MailboxManager point of view thus it could be carried out asynchronously, via mailbox listeners so that it can be retried.
Mailbox listener failures lead to eventBus retrying their execution, we need to ensure the result of the deletion to be idempotent.