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: proxy detects non-consecutive duplicates #550

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

dorjesinpo
Copy link
Collaborator

Fixing the case of non-consecutive PUSH duplicates

@dorjesinpo dorjesinpo added the bug Something isn't working label Dec 16, 2024
@dorjesinpo dorjesinpo requested a review from a team as a code owner December 16, 2024 20:25
@dorjesinpo dorjesinpo requested review from pniedzielski and removed request for a team December 16, 2024 21:08
@dorjesinpo dorjesinpo force-pushed the fix/duplicate-detection-in-proxy branch from d4b73aa to c658247 Compare December 16, 2024 21:09
@dorjesinpo dorjesinpo changed the title fix: proxy detects non-consecutive duplicates [WIP] fix: proxy detects non-consecutive duplicates Dec 17, 2024
@dorjesinpo dorjesinpo force-pushed the fix/duplicate-detection-in-proxy branch from c658247 to a6dcd0d Compare December 18, 2024 15:13
@dorjesinpo dorjesinpo changed the title [WIP] fix: proxy detects non-consecutive duplicates fix: proxy detects non-consecutive duplicates Dec 18, 2024
Copy link
Collaborator

@pniedzielski pniedzielski left a comment

Choose a reason for hiding this comment

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

I think the logic looks correct to me. I have some very minor comments. The one I couldn't quite track is why the call to setup is being removed from the virtual storage catalog.


App(const bsl::shared_ptr<RelayQueueEngine_AppState>& app);
void add(Element* element);
void remove(Element* element);

/// Return 'true'
Copy link
Collaborator

Choose a reason for hiding this comment

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

This documentation comment doesn't seem correct/seems unfinished.

// The current element has made it either to delivery or
// putAside and it can be removed
d_storageIter_mp->removeCurrentElement();
else if (element->app().setLastPush(d_storageIter_mp->guid())) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we break this function into isLastPush(guid) (pure function, does not set state) and setLastPush(guid) (unconditionally overwrites state)? This condition is very hard to understand, reading it as English, and the return value is already ignored in the else branch below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok. we also need removeCurrentElement

@@ -270,7 +270,6 @@ VirtualStorageCatalog::confirm(const bmqt::MessageGUID& msgGUID,
VirtualStoragesIter it = d_virtualStorages.findByKey2(appKey);
BSLS_ASSERT_SAFE(it != d_virtualStorages.end());

setup(&data->second);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this being removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

VirtualStorageCatalog::get calls setup so the second call was redundant

Signed-off-by: dorjesinpo <[email protected]>
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 417 of commit 7aee933 has completed with FAILURE

@pniedzielski pniedzielski self-requested a review January 6, 2025 21:23
@dorjesinpo dorjesinpo merged commit 8d7d77a into main Jan 7, 2025
37 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