| 815 | #[tracing::instrument(level = "trace", skip_all)] |
| 816 | #[allow(clippy::type_complexity)] |
| 817 | pub fn commit_tx( |
| 818 | &self, |
| 819 | tx: MutTx, |
| 820 | ) -> Result<Option<(TxOffset, Arc<TxData>, TxMetrics, Option<ReducerName>)>, DBError> { |
| 821 | log::trace!("COMMIT MUT TX"); |
| 822 | |
| 823 | let reducer_context = tx.ctx.reducer_context().cloned(); |
| 824 | // TODO: Never returns `None` -- should it? |
| 825 | let Some((tx_offset, tx_data, tx_metrics, reducer)) = self.inner.commit_mut_tx_and_then(tx, |tx_data| { |
| 826 | self.request_durability(reducer_context, tx_data); |
| 827 | })? |
| 828 | else { |
| 829 | return Ok(None); |
| 830 | }; |
| 831 | |
| 832 | self.maybe_do_snapshot(&tx_data); |
| 833 | |
| 834 | Ok(Some((tx_offset, tx_data, tx_metrics, reducer))) |
| 835 | } |
| 836 | |
| 837 | #[tracing::instrument(level = "trace", skip_all)] |
| 838 | pub fn commit_tx_downgrade(&self, tx: MutTx, workload: Workload) -> (Arc<TxData>, TxMetrics, Tx) { |