Skip to content

Commit 4577b69

Browse files
authored
Fix[mqbs::FileStore]: Do not remove purge record even if app is deleted (#425)
Signed-off-by: Yuan Jing Vincent Yan <[email protected]>
1 parent 182a8ab commit 4577b69

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

src/groups/mqb/mqbc/mqbc_storageutil.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1957,7 +1957,9 @@ void StorageUtil::recoveredQueuesCb(
19571957
// (something like 'inRecovery=true'), based on which storage
19581958
// implementation may or may not invoke certain business logic.
19591959

1960-
rs->purge(appKey);
1960+
if (rs->hasVirtualStorage(appKey)) {
1961+
rs->purge(appKey);
1962+
}
19611963
}
19621964

19631965
// TBD: check if adding 'else if' clauses for 'ADDITION',

src/groups/mqb/mqbs/mqbs_filestore.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,23 +1732,7 @@ int FileStore::recoverMessages(QueueKeyInfoMap* queueKeyInfoMap,
17321732
}
17331733
}
17341734

1735-
if (!appKey.isNull()) {
1736-
// Specific appKey is purged.
1737-
StorageKeysOffsetsConstIter appKeyIt =
1738-
deletedAppKeysOffsets.find(appKey);
1739-
1740-
if (appKeyIt != deletedAppKeysOffsets.end()) {
1741-
BSLS_ASSERT_SAFE(jit->recordOffset() !=
1742-
appKeyIt->second);
1743-
if (jit->recordOffset() < appKeyIt->second) {
1744-
// This record appears before the QueueOp.DELETION
1745-
// record for this appKey so should be ignored.
1746-
1747-
continue; // CONTINUE
1748-
}
1749-
}
1750-
}
1751-
else {
1735+
if (appKey.isNull()) {
17521736
// Entire queue is purged.
17531737
purgedQueueKeys.insert(queueKey);
17541738
}

0 commit comments

Comments
 (0)