diff --git a/core/mvcc/mvcc-rs/src/database/mod.rs b/core/mvcc/mvcc-rs/src/database/mod.rs index 4bdde3b12..f425e01b1 100644 --- a/core/mvcc/mvcc-rs/src/database/mod.rs +++ b/core/mvcc/mvcc-rs/src/database/mod.rs @@ -515,7 +515,7 @@ impl Database { let end_ts = self.get_timestamp(); // NOTICE: the first shadowed tx keeps the entry alive in the map // for the duration of this whole function, which is important for correctness! - let tx = self.txs.get(&tx_id).unwrap(); + let tx = self.txs.get(&tx_id).ok_or(DatabaseError::TxTerminated)?; let tx = tx.value().write().unwrap(); match tx.state.load() { TransactionState::Terminated => return Err(DatabaseError::TxTerminated),