Fix[MQBC]: skip FSM events if primary goes down - #1193
Merged
Conversation
678098
force-pushed
the
260313_fix_nodeId_assert
branch
from
March 13, 2026 19:56
8ec0af2 to
d1dc15c
Compare
678098
force-pushed
the
260313_fix_nodeId_assert
branch
2 times, most recently
from
March 16, 2026 21:17
b898ca8 to
985570f
Compare
678098
commented
Mar 17, 2026
678098
force-pushed
the
260313_fix_nodeId_assert
branch
from
March 17, 2026 15:25
985570f to
8e2a519
Compare
kaikulimu
previously approved these changes
Mar 17, 2026
678098
force-pushed
the
260313_fix_nodeId_assert
branch
11 times, most recently
from
March 18, 2026 20:10
8266fae to
236a881
Compare
dorjesinpo
reviewed
Mar 19, 2026
| << d_partitionInfoVec[partitionId].primaryLeaseId(); | ||
|
|
||
| bmqp_ctrlmsg::ControlMessage controlMsg; | ||
| controlMsg.rId() = evt.requestId(); |
Collaborator
There was a problem hiding this comment.
The event may not be a request in which case there is no need to build and send a response.
678098
force-pushed
the
260313_fix_nodeId_assert
branch
6 times, most recently
from
March 20, 2026 18:51
2ec5435 to
d54459a
Compare
678098
commented
Mar 20, 2026
| failureResponse.code() = mqbi::ClusterErrorCode::e_NOT_REPLICA; | ||
| failureResponse.message() = "Not a replica"; | ||
| failureResponse.code() = mqbi::ClusterErrorCode::e_UNKNOWN; | ||
| failureResponse.message() = "Primary mismatch"; |
Collaborator
Author
There was a problem hiding this comment.
This test was failing due to the early reject mechanism.
I have updated the expected output.
The error log from UT:
TEST /home/runner/work/blazingmq/blazingmq/src/groups/mqb/mqbc/mqbc_storagemana
ger.t.cpp CASE 4
20MAR2026_18:33:15.939 18823:140470192740224 WARN /home/runner/work/blazingmq/bla
zingmq/src/groups/mqb/mqbc/mqbc_storagemanager.cpp:401 MQBC.STORAGEMANAGER
Cluster (testCluster) Partition [0]: dropping stale event: source [W1, 3], event
primaryLeaseId [1], current primaryLeaseId [1], event primary [[W1, 3]], current
primary [[E2, 2]]
Error /home/runner/work/blazingmq/blazingmq/src/groups/mqb/mqbc/mqbc_storagemanag
er.t.cpp(593): 'message' ([ rId = 1 choice = [ status = [ category = E_REFUSED
code = -10 message = "Primary mismatch" ] ] ]) == 'failureMessage' ([ rId = 1
choice = [ status = [ category = E_REFUSED code = -207 message = "Not a replica"
] ] ]) (failed)
678098
force-pushed
the
260313_fix_nodeId_assert
branch
from
March 20, 2026 19:08
d54459a to
3ad83b2
Compare
Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
678098
force-pushed
the
260313_fix_nodeId_assert
branch
from
March 24, 2026 15:03
3ad83b2 to
b181724
Compare
kaikulimu
approved these changes
Mar 25, 2026
Collaborator
|
A splendidly crafted PR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add missing state transition
UNKNOWN->RST_PRIMARY->UNKNOWNThis updates primary in partition thread.
In FSM mode, update primary only from FSM.
Keep directly calling
storageManager->setPrimaryForPartitionandstorageManager->clearPrimaryForPartitionin legacy mode.Skip enqueueing an event to FSM if primaryLeaseId is outdated or there is a primary mismatch.
Update UT to catch new "Primary mismatch" error.