Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat[MQB]: Do not record last confirm #442

Merged
merged 17 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/groups/mqb/mqbs/mqbs_filebackedstorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,10 @@ FileBackedStorage::confirm(const bmqt::MessageGUID& msgGUID,
RecordHandlesArray& handles = it->second.d_array;
BSLS_ASSERT_SAFE(!handles.empty());

if (0 == --it->second.d_refCount) {
678098 marked this conversation as resolved.
Show resolved Hide resolved
return mqbi::StorageResult::e_ZERO_REFERENCES; // RETURN
}

DataStoreRecordHandle handle;
const int writeResult = d_store_p->writeConfirmRecord(
&handle,
Expand All @@ -407,10 +411,6 @@ FileBackedStorage::confirm(const bmqt::MessageGUID& msgGUID,

handles.push_back(handle);

if (0 == --it->second.d_refCount) {
return mqbi::StorageResult::e_ZERO_REFERENCES; // RETURN
}

return mqbi::StorageResult::e_NON_ZERO_REFERENCES;
}

Expand Down
2 changes: 1 addition & 1 deletion src/groups/mqb/mqbs/mqbs_filebackedstorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class FileBackedStorage BSLS_KEYWORD_FINAL : public ReplicatedStorage {
// Most likely number of records for each guid (one each of message,
// confirm & deletion record). This number is correct for every queue
// except for the fanout one, which has more than 1 confirm records.
bbpetukhov marked this conversation as resolved.
Show resolved Hide resolved
static const size_t k_MOST_LIKELY_NUM_RECORDS = 3;
static const size_t k_MOST_LIKELY_NUM_RECORDS = 2;

// PRIVATE TYPES
typedef mwcc::Array<DataStoreRecordHandle, k_MOST_LIKELY_NUM_RECORDS>
Expand Down
Loading
Loading