-
Notifications
You must be signed in to change notification settings - Fork 141
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
Add support for 'isFSMWorkflow' flag and fix FSM workflow #161
Conversation
6bf3068
to
7a4ca95
Compare
@678098 Addressed your comments. Can review again. |
@dorjesinpo is going to make some changes near |
@678098's work on purge queue command can potentially conflict with this PR, too. Must be careful. |
02ad95b
to
f7af3f4
Compare
9c029f6
to
fc31a38
Compare
4cc4d4a
to
7bb2371
Compare
9578dc8
to
c8b9092
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.
Not a thorough review (quarter-note has reviewed before)
Some minor notes
@@ -7,8 +7,8 @@ | |||
// | |||
// http://www.apache.org/licenses/LICENSE-2.0 | |||
// | |||
// Unless required by applicable law or agreed to in writing, software | |||
// distributed under the License is distributed on an "AS IS" BASIS, | |||
// Unless required byClusterDataIdentityapplicable law or agreed to in writing, |
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.
Unless required by applicable law ...
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.
done
@@ -3605,8 +3628,6 @@ Cluster::sendRequest(const Cluster::RequestManagerType::RequestSp& request, | |||
mqbnet::ClusterNode* target, | |||
bsls::TimeInterval timeout) | |||
{ | |||
// executed by the cluster *DISPATCHER* thread |
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.
Is that not in the Dispatcher thread anymore? If so, need to comment on the thread safety
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.
Yes, it is now possible to be invoked in the queue dispatcher thread by mqbc::StorageManager
:
bmqt::GenericResult::Enum status = d_clusterData_p->cluster()->sendRequest( |
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.
ElectorInfo::setElectorInfo
is "executed by the cluster DISPATCHER thread" so we need to put some warning about thread safety. We consider the access to d_leaderNode_p
(and everything else here) thread-safe.
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.
Added some comment about thread safety. Importantly, Cluster::sendRequest()
has been invoked in queue dispatcher threads since before FSM, for example at RecoveryManager::onPartitionSyncStateQueryResponseDispatched()
.
if (bdls::ProcessUtil::getProcessName(&(identity.processName())) != 0) { | ||
identity.processName() = "** UNKNOWN **"; | ||
bmqp_ctrlmsg::ClientIdentity identity(allocator); | ||
if (!isRemote) { |
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.
Is there no need for proxy detailed identity?
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.
If you look at eb05973 where this change is made, you will see that the original code was:
, d_identity(cluster->isRemote()
? ClusterDataIdentity(name,
bmqp_ctrlmsg::ClientIdentity(allocator),
allocator)
: clusterIdentity(name, d_membership.netCluster()))
Hence, if we are a remote node, an empty bmqp_ctrlmsg::ClientIdentity
is passed in.
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.
I merely refactored and simplified the code.
@@ -785,6 +798,8 @@ void ClusterUtil::populateQueueAssignmentAdvisory( | |||
BSLS_ASSERT_SAFE(domain); | |||
BSLS_ASSERT_SAFE(clusterData->electorInfo().isSelfActiveLeader()); | |||
|
|||
BALL_LOG_SET_CATEGORY(k_LOG_CATEGORY); |
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.
Do we need it (considering BALL_LOG_SET_CLASS_CATEGORY("MQBC.CLUSTERUTIL");)
?
And below
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.
Good catch, these lines are redundant. Will remove them.
Signed-off-by: Yuan Jing Vincent Yan <[email protected]>
Signed-off-by: Yuan Jing Vincent Yan <[email protected]>
Signed-off-by: Yuan Jing Vincent Yan <[email protected]>
Signed-off-by: Yuan Jing Vincent Yan <[email protected]>
Signed-off-by: Yuan Jing Vincent Yan <[email protected]>
Signed-off-by: Yuan Jing Vincent Yan <[email protected]>
Signed-off-by: Yuan Jing Vincent Yan <[email protected]>
Signed-off-by: Yuan Jing Vincent Yan <[email protected]>
Signed-off-by: Yuan Jing Vincent Yan <[email protected]>
Signed-off-by: Yuan Jing Vincent Yan <[email protected]>
Signed-off-by: Yuan Jing Vincent Yan <[email protected]>
Signed-off-by: Yuan Jing Vincent Yan <[email protected]>
Signed-off-by: Yuan Jing Vincent Yan <[email protected]>
@dorjesinpo Ready for review again |
Add support for FSM workflow of cluster node startup sequence
Note:
70beb20 adopts Vitaly's #174 into this PR
751032b adopts Vitaly's #190 into this PR