-
Notifications
You must be signed in to change notification settings - Fork 131
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
Performance[MQB]: inline Put, Push, Ack, Confirm #177
base: main
Are you sure you want to change the base?
Conversation
6d2f55e
to
e21c4cd
Compare
Hi @dorjesinpo, looking |
Signed-off-by: Vitaly Dzhitenov <vdzhitenov@bloomberg.net>
Signed-off-by: Vitaly Dzhitenov <vdzhitenov@bloomberg.net>
e21c4cd
to
51bc378
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for reviewing!
@@ -369,6 +345,8 @@ void ClusterProxy::onActiveNodeUp(mqbnet::ClusterNode* activeNode) | |||
return; // RETURN | |||
} | |||
|
|||
d_activeNode_p = activeNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because d_activeNode_p
is (half) protected by d_gateActiveNode
- it is safe to use if mqbc::GateKeeper::Status(d_gateActiveNode).isOpen()
d_activeNodeManager.activeNode()
does not provide such guarantee.
I agree, this calls for refactoring, not in this PR, perhaps
pinfo.primaryLeaseId()); | ||
} | ||
} | ||
|
||
// TODO: this code assumes that it is safe to send PUTs and CONFIRMS at | ||
// this point if the status is E_ACTIVE or close the gate otherwise. | ||
// May need to open the gate later/close earlier by a separate call. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mimics the existing functionality. If the status is E_ACTIVE
we call Channel::writeConfirm/writePut
.
If the channel fails to write, confirm may get lost resulting in duplicate PUSH, and PUT will be retransmitted.
@dorjesinpo thank you for fixes, added some comments in discussions and reassigned. You can assign this to @quarter-note later |
Signed-off-by: Vitaly Dzhitenov <vdzhitenov@bloomberg.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build 190 of commit 7d0e9c7 has completed with FAILURE
Messages that have fixed destination (such as PUSH/ACK/Relay PUT/Relay CONFIRM) do not have to go on Cluster thread - it is a bottleneck.
Instead, messages can go directly to mqbnet::Channel which enqueues them in thread-safe manner.
This needs synchronization based on AtomicGate which allows thread-safe, efficient checking of the cluster status and thread-safe opening/closing and draining.
PUSH and ACK require statistics update which we move from Cluster to Queue. For this reason the opening queue context (OpenQueueConfirmationCookie) conveys statistics from Queue to Cluster