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

fix PushStream & VirtualStorage ordinal #528

Merged
merged 1 commit into from
Nov 26, 2024
Merged

Conversation

dorjesinpo
Copy link
Collaborator

@dorjesinpo dorjesinpo commented Nov 24, 2024

Fixing bugs related to the Monolithic Storage

  1. VS ordinal recycling (this assert)
  2. Empty PushStream::Element in RelayQueueEngine::beforeMessageRemoved (this assert)

@dorjesinpo dorjesinpo added the bug Something isn't working label Nov 24, 2024
@dorjesinpo dorjesinpo requested a review from a team as a code owner November 24, 2024 18:42
Copy link

@bmq-oss-ci bmq-oss-ci bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build 383 of commit bb23660 has completed with FAILURE

@@ -86,7 +86,7 @@ class VirtualStorageCatalog {
typedef bsl::shared_ptr<VirtualStorage> VirtualStorageSp;

/// List of available ordinal values for Virtual Storages.
typedef bsl::list<Ordinal> AvailableOrdinals;
typedef bsl::set<Ordinal> AvailableOrdinals;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine. Ensures that we always get the smallest available ordinal, and we're not going to incur the cost of chasing a few more pointers in the critical path.

@@ -673,7 +660,15 @@ inline unsigned int PushStream::remove(Element* element)
// remove from the guid
element->guid().remove(element, e_GUID);

return element->guid().numElements();
if (element->app().d_elements.numElements() == 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Centralizing this bit of logic as here seems right. I've traced through the code paths leading up to this and I think this catches all places we need.

@dorjesinpo dorjesinpo merged commit a5f8a06 into main Nov 26, 2024
42 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants