diff --git a/engines/ep/src/kvstore/magma-kvstore/magma-kvstore.cc b/engines/ep/src/kvstore/magma-kvstore/magma-kvstore.cc index 4d20d39ae0..e6bab24457 100644 --- a/engines/ep/src/kvstore/magma-kvstore/magma-kvstore.cc +++ b/engines/ep/src/kvstore/magma-kvstore/magma-kvstore.cc @@ -2894,6 +2894,7 @@ RollbackResult MagmaKVStore::rollback(Vbid vbid, case Status::NotFound: case Status::Cancelled: case Status::RetryCompaction: + case Status::RangeNotFound: logger->critical("MagmaKVStore::rollback Rollback {} status:{}", vbid, status.String()); diff --git a/engines/ep/src/kvstore/magma-kvstore/magma-memory-tracking-proxy.cc b/engines/ep/src/kvstore/magma-kvstore/magma-memory-tracking-proxy.cc index 0ce214674a..2057f93bae 100644 --- a/engines/ep/src/kvstore/magma-kvstore/magma-memory-tracking-proxy.cc +++ b/engines/ep/src/kvstore/magma-kvstore/magma-memory-tracking-proxy.cc @@ -31,6 +31,14 @@ DomainAwareSeqIterator::~DomainAwareSeqIterator() { itr.reset(); } +magma::Status DomainAwareSeqIterator::Initialize( + const magma::Magma::SeqNo startSeqno, + const magma::Magma::SeqNo endSeqno, + Mode mode) { + cb::UseArenaMallocSecondaryDomain domainGuard; + return itr->Initialize(startSeqno, endSeqno, mode); +} + magma::Status DomainAwareSeqIterator::GetStatus() { cb::UseArenaMallocSecondaryDomain domainGuard; return itr->GetStatus(); @@ -447,6 +455,17 @@ void MagmaMemoryTrackingProxy::SetNumThreads( magma->SetNumThreads(threadType, nThreads); } +void MagmaMemoryTrackingProxy::SetHistoryRetentionSize(size_t historyBytes) { + cb::UseArenaMallocSecondaryDomain domainGuard; + magma->SetHistoryRetentionSize(historyBytes); +} + +void MagmaMemoryTrackingProxy::SetHistoryRetentionTime( + uint64_t historySeconds) { + cb::UseArenaMallocSecondaryDomain domainGuard; + magma->SetHistoryRetentionTime(historySeconds); +} + magma::Status MagmaMemoryTrackingProxy::Sync(bool flushAll) { cb::UseArenaMallocSecondaryDomain domainGuard; return magma->Sync(flushAll); @@ -513,3 +532,15 @@ magma::Status MagmaMemoryTrackingProxy::ResumeBGCompaction( cb::UseArenaMallocSecondaryDomain domainGuard; return magma->ResumeBGCompaction(kvID); } + +magma::Magma::SeqNo MagmaMemoryTrackingProxy::GetOldestHistorySeqno( + magma::Magma::KVStoreID kvid) { + cb::UseArenaMallocSecondaryDomain domainGuard; + return magma->GetOldestHistorySeqno(kvid); +} + +magma::Magma::SeqNo MagmaMemoryTrackingProxy::GetOldestHistorySeqno( + magma::Magma::Snapshot& snapshot) { + cb::UseArenaMallocSecondaryDomain domainGuard; + return magma->GetOldestHistorySeqno(snapshot); +} diff --git a/engines/ep/src/kvstore/magma-kvstore/magma-memory-tracking-proxy.h b/engines/ep/src/kvstore/magma-kvstore/magma-memory-tracking-proxy.h index 18d3cdbdd8..cba996303d 100644 --- a/engines/ep/src/kvstore/magma-kvstore/magma-memory-tracking-proxy.h +++ b/engines/ep/src/kvstore/magma-kvstore/magma-memory-tracking-proxy.h @@ -48,6 +48,9 @@ class DomainAwareSeqIterator : public magma::Magma::SeqIterator { : itr(std::move(itr)) { } ~DomainAwareSeqIterator() override; + magma::Status Initialize(const magma::Magma::SeqNo startSeqno, + const magma::Magma::SeqNo endSeqno, + Mode mode) override; void Seek(const magma::Magma::SeqNo startSeqno, const magma::Magma::SeqNo endSeqno) override; bool Valid() override; @@ -205,6 +208,9 @@ class MagmaMemoryTrackingProxy { void EnableBlockCache(bool enable); void SetMemoryQuota(const size_t quota); void SetNumThreads(magma::Magma::ThreadType threadType, size_t nThreads); + void SetHistoryRetentionSize(size_t historyBytes); + void SetHistoryRetentionTime(uint64_t historySeconds); + magma::Status Sync(bool flushAll); magma::Status SyncKVStore(const magma::Magma::KVStoreID kvID); @@ -221,6 +227,9 @@ class MagmaMemoryTrackingProxy { magma::Status StopBGCompaction(const magma::Magma::KVStoreID kvID); magma::Status ResumeBGCompaction(const magma::Magma::KVStoreID kvID); + magma::Magma::SeqNo GetOldestHistorySeqno(magma::Magma::KVStoreID kvid); + magma::Magma::SeqNo GetOldestHistorySeqno(magma::Magma::Snapshot& snapshot); + private: std::unique_ptr magma; }; \ No newline at end of file