| 2648 | } |
| 2649 | |
| 2650 | void TxGraphImpl::AbortStaging() noexcept |
| 2651 | { |
| 2652 | // Staging must exist. |
| 2653 | Assume(m_staging_clusterset.has_value()); |
| 2654 | // Mark all removed transactions as Missing (so the staging locator for these transactions |
| 2655 | // can be reused if another staging is created). |
| 2656 | for (auto idx : m_staging_clusterset->m_removed) { |
| 2657 | m_entries[idx].m_locator[1].SetMissing(); |
| 2658 | } |
| 2659 | // Do the same with the non-removed transactions in staging Clusters. |
| 2660 | for (int quality = 0; quality < int(QualityLevel::NONE); ++quality) { |
| 2661 | for (auto& cluster : m_staging_clusterset->m_clusters[quality]) { |
| 2662 | cluster->MakeStagingTransactionsMissing(*this); |
| 2663 | } |
| 2664 | } |
| 2665 | // Destroy the staging ClusterSet. |
| 2666 | m_staging_clusterset.reset(); |
| 2667 | Compact(); |
| 2668 | if (!m_main_clusterset.m_group_data.has_value()) { |
| 2669 | // In case m_oversized in main was kept after a Ref destruction while staging exists, we |
| 2670 | // need to re-evaluate m_oversized now. |
| 2671 | if (m_main_clusterset.m_to_remove.empty() && m_main_clusterset.m_txcount_oversized > 0) { |
| 2672 | // It is possible that a Ref destruction caused a removal in main while staging existed. |
| 2673 | // In this case, m_txcount_oversized may be inaccurate. |
| 2674 | m_main_clusterset.m_oversized = true; |
| 2675 | } else { |
| 2676 | m_main_clusterset.m_oversized = std::nullopt; |
| 2677 | } |
| 2678 | } |
| 2679 | } |
| 2680 | |
| 2681 | void TxGraphImpl::CommitStaging() noexcept |
| 2682 | { |