LICENSED TO CUSTOMERS OF A COMMERCIAL SUBSCRIPTION ONLY!
Listener to maintain the RemoteParticipantLogEntryCache, so that:
- RemoteParticipantLogEntry instances constructed from TransactionPreparingEvent occurrences
which happen at prepare-time (i.e., when state is TxState.PREPARING). But this state is not recoverable
so no logging is done yet. Consequently, this information is stored in the cache until the OLTP log needs it
(upon later write time of the PendingTransactionRecord for a recoverable state).
- For transactions that never reach a recoverable state, we want to make sure their information is purged
from the cache (to avoid memory leaks) - which is done by listening for the right events here.
- To limit the amount of remote work to inspect by recovery, we also purge both the cache and the logs
when OLTP can do a clean commit or rollback - because recovery is then no longer needed.