Skip to content

Commit

Permalink
mqbs::FileStore: Do not remove purge record even if app is deleted
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Jing Vincent Yan <[email protected]>
  • Loading branch information
kaikulimu committed Sep 27, 2024
1 parent c186674 commit adb42e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
4 changes: 3 additions & 1 deletion src/groups/mqb/mqbc/mqbc_storageutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
18 changes: 1 addition & 17 deletions src/groups/mqb/mqbs/mqbs_filestore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit adb42e7

Please sign in to comment.