From adb42e7c37887eb33dfc990449b52fa6994d9c28 Mon Sep 17 00:00:00 2001 From: Yuan Jing Vincent Yan Date: Fri, 27 Sep 2024 15:14:02 -0400 Subject: [PATCH] mqbs::FileStore: Do not remove purge record even if app is deleted Signed-off-by: Yuan Jing Vincent Yan --- src/groups/mqb/mqbc/mqbc_storageutil.cpp | 4 +++- src/groups/mqb/mqbs/mqbs_filestore.cpp | 18 +----------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/groups/mqb/mqbc/mqbc_storageutil.cpp b/src/groups/mqb/mqbc/mqbc_storageutil.cpp index 60eace567..96d17dd26 100644 --- a/src/groups/mqb/mqbc/mqbc_storageutil.cpp +++ b/src/groups/mqb/mqbc/mqbc_storageutil.cpp @@ -2034,7 +2034,9 @@ void StorageUtil::recoveredQueuesCb( // (something like 'inRecovery=true'), based on which storage // implementation may or may not invoke certain business logic. - rs->purge(appKey); + if (rs->hasVirtualStorage(appKey)) { + rs->purge(appKey); + } } // TBD: check if adding 'else if' clauses for 'ADDITION', diff --git a/src/groups/mqb/mqbs/mqbs_filestore.cpp b/src/groups/mqb/mqbs/mqbs_filestore.cpp index de99589ab..5274821fc 100644 --- a/src/groups/mqb/mqbs/mqbs_filestore.cpp +++ b/src/groups/mqb/mqbs/mqbs_filestore.cpp @@ -1733,23 +1733,7 @@ int FileStore::recoverMessages(QueueKeyInfoMap* queueKeyInfoMap, } } - if (!appKey.isNull()) { - // Specific appKey is purged. - StorageKeysOffsetsConstIter appKeyIt = - deletedAppKeysOffsets.find(appKey); - - if (appKeyIt != deletedAppKeysOffsets.end()) { - BSLS_ASSERT_SAFE(jit->recordOffset() != - appKeyIt->second); - if (jit->recordOffset() < appKeyIt->second) { - // This record appears before the QueueOp.DELETION - // record for this appKey so should be ignored. - - continue; // CONTINUE - } - } - } - else { + if (appKey.isNull()) { // Entire queue is purged. purgedQueueKeys.insert(queueKey); }