@@ -70,19 +70,24 @@ void ClusterStateManager::onCommit(
70
70
BSLS_ASSERT_SAFE (dispatcher ()->inDispatcherThread (d_cluster_p));
71
71
BSLS_ASSERT_SAFE (advisory.choice ().isClusterMessageValue ());
72
72
73
- // NOTE: Even when using old workflow, we still apply all advisories to the
74
- // CSL. We just don't invoke the commit callbacks.
75
- if (!d_clusterConfig.clusterAttributes ().isCSLModeEnabled ()) {
76
- return ; // RETURN
77
- }
78
-
79
73
if (status != mqbc::ClusterStateLedgerCommitStatus::e_SUCCESS) {
80
74
BALL_LOG_ERROR << d_clusterData_p->identity ().description ()
81
75
<< " : Failed to commit advisory: " << advisory
82
76
<< " , with status '" << status << " '" ;
83
77
return ; // RETURN
84
78
}
85
79
80
+ const bmqp_ctrlmsg::ClusterMessage& clusterMessage =
81
+ advisory.choice ().clusterMessage ();
82
+
83
+ // NOTE: Even when using old workflow, we still apply all advisories to the
84
+ // CSL. We just don't invoke the commit callbacks.
85
+ // Make an exception for QueueAssignmentAdvisory
86
+ if (!d_clusterConfig.clusterAttributes ().isCSLModeEnabled () &&
87
+ !clusterMessage.choice ().isQueueAssignmentAdvisoryValue ()) {
88
+ return ; // RETURN
89
+ }
90
+
86
91
// Commenting out following 'if' check to fix an assert during node
87
92
// shutdown.
88
93
// if ( d_clusterData_p->membership().selfNodeStatus()
@@ -94,8 +99,6 @@ void ClusterStateManager::onCommit(
94
99
<< " : Committed advisory: " << advisory << " , with status '"
95
100
<< status << " '" ;
96
101
97
- const bmqp_ctrlmsg::ClusterMessage& clusterMessage =
98
- advisory.choice ().clusterMessage ();
99
102
mqbc::ClusterUtil::apply (d_state_p, clusterMessage, *d_clusterData_p);
100
103
}
101
104
@@ -1481,7 +1484,8 @@ void ClusterStateManager::processQueueAssignmentRequest(
1481
1484
void ClusterStateManager::processQueueAssignmentAdvisory (
1482
1485
const bmqp_ctrlmsg::ControlMessage& message,
1483
1486
mqbnet::ClusterNode* source,
1484
- bool delayed)
1487
+ bool delayed,
1488
+ bool fromLeaderAdvisory)
1485
1489
{
1486
1490
// executed by the cluster *DISPATCHER* thread
1487
1491
@@ -1690,16 +1694,21 @@ void ClusterStateManager::processQueueAssignmentAdvisory(
1690
1694
}
1691
1695
}
1692
1696
else {
1693
- AppInfos appIdInfos (d_allocator_p);
1697
+ if (delayed || fromLeaderAdvisory) {
1698
+ AppInfos appIdInfos (d_allocator_p);
1694
1699
1695
- mqbc::ClusterUtil::parseQueueInfo (&appIdInfos,
1696
- queueInfo,
1697
- d_allocator_p);
1700
+ mqbc::ClusterUtil::parseQueueInfo (&appIdInfos,
1701
+ queueInfo,
1702
+ d_allocator_p);
1698
1703
1699
- d_state_p->assignQueue (uri,
1700
- queueKey,
1701
- queueInfo.partitionId (),
1702
- appIdInfos);
1704
+ d_state_p->assignQueue (uri,
1705
+ queueKey,
1706
+ queueInfo.partitionId (),
1707
+ appIdInfos);
1708
+ }
1709
+ // When this function is called from
1710
+ // processQueueAssignmentAdvisory, assignQueue will
1711
+ // be triggered through mqbblp::ClusterStateManager::onCommit
1703
1712
}
1704
1713
1705
1714
BALL_LOG_INFO << d_cluster_p->description ()
@@ -2150,7 +2159,10 @@ void ClusterStateManager::processLeaderAdvisory(
2150
2159
queueAsgnAdv.sequenceNumber () = advisory.sequenceNumber ();
2151
2160
queueAsgnAdv.queues () = advisory.queues ();
2152
2161
2153
- processQueueAssignmentAdvisory (controlMsg, source);
2162
+ processQueueAssignmentAdvisory (controlMsg,
2163
+ source,
2164
+ false /* not delayed */ ,
2165
+ true /* called from leaderAdvisory */ );
2154
2166
2155
2167
// Leader status and sequence number are updated unconditionally. It may
2156
2168
// have been updated by one of the routines called earlier in this method,
0 commit comments