Skip to content

Commit

Permalink
Allow QueueAssignmentAdvisory do CSL from the second part of LeaderAd…
Browse files Browse the repository at this point in the history
…visory

Signed-off-by: Emelia Lei <[email protected]>
  • Loading branch information
emelialei88 committed Jan 24, 2025
1 parent e3d18b9 commit 852e459
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
6 changes: 2 additions & 4 deletions src/groups/mqb/mqbblp/mqbblp_clusterstatemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1484,8 +1484,7 @@ void ClusterStateManager::processQueueAssignmentRequest(
void ClusterStateManager::processQueueAssignmentAdvisory(
const bmqp_ctrlmsg::ControlMessage& message,
mqbnet::ClusterNode* source,
bool delayed,
bool fromLeaderAdvisory)
bool delayed)
{
// executed by the cluster *DISPATCHER* thread

Expand Down Expand Up @@ -2161,8 +2160,7 @@ void ClusterStateManager::processLeaderAdvisory(

processQueueAssignmentAdvisory(controlMsg,
source,
false /* not delayed */,
true /* called from leaderAdvisory */);
false /* not delayed */);

// Leader status and sequence number are updated unconditionally. It may
// have been updated by one of the routines called earlier in this method,
Expand Down
9 changes: 4 additions & 5 deletions src/groups/mqb/mqbblp/mqbblp_clusterstatemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,10 @@ class ClusterStateManager BSLS_KEYWORD_FINAL
/// TODO_CSL: This is the current workflow which we should be able to
/// remove after the new workflow via
/// ClusterQueueHelper::onQueueAssigned() is stable.
void processQueueAssignmentAdvisory(
const bmqp_ctrlmsg::ControlMessage& message,
mqbnet::ClusterNode* source,
bool delayed = false,
bool fromLeaderAdvisory = false) BSLS_KEYWORD_OVERRIDE;
void
processQueueAssignmentAdvisory(const bmqp_ctrlmsg::ControlMessage& message,
mqbnet::ClusterNode* source,
bool delayed = false) BSLS_KEYWORD_OVERRIDE;

/// Process the queue unAssigned advisory in the specified `message`
/// received from the specified `source`.
Expand Down
3 changes: 1 addition & 2 deletions src/groups/mqb/mqbc/mqbc_clusterstatemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1784,8 +1784,7 @@ void ClusterStateManager::processQueueAssignmentRequest(
void ClusterStateManager::processQueueAssignmentAdvisory(
BSLS_ANNOTATION_UNUSED const bmqp_ctrlmsg::ControlMessage& message,
BSLS_ANNOTATION_UNUSED mqbnet::ClusterNode* source,
BSLS_ANNOTATION_UNUSED bool delayed,
BSLS_ANNOTATION_UNUSED bool fromLeaderAdvisory)
BSLS_ANNOTATION_UNUSED bool delayed)
{
BSLS_ASSERT_SAFE(false &&
"This method should only be invoked in non-CSL mode");
Expand Down
9 changes: 4 additions & 5 deletions src/groups/mqb/mqbc/mqbc_clusterstatemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -589,11 +589,10 @@ class ClusterStateManager BSLS_KEYWORD_FINAL
/// TODO_CSL: This is the current workflow which we should be able to
/// remove after the new workflow via
/// ClusterQueueHelper::onQueueAssigned() is stable.
void processQueueAssignmentAdvisory(
const bmqp_ctrlmsg::ControlMessage& message,
mqbnet::ClusterNode* source,
bool delayed = false,
bool fromLeaderAdvisory = false) BSLS_KEYWORD_OVERRIDE;
void
processQueueAssignmentAdvisory(const bmqp_ctrlmsg::ControlMessage& message,
mqbnet::ClusterNode* source,
bool delayed = false) BSLS_KEYWORD_OVERRIDE;

/// Process the queue unAssigned advisory in the specified `message`
/// received from the specified `source`.
Expand Down
7 changes: 3 additions & 4 deletions src/groups/mqb/mqbi/mqbi_clusterstatemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ class ClusterStateManager {
AfterPartitionPrimaryAssignmentCb;

/// Pair of (appId, appKey)
typedef bsl::pair<bsl::string, mqbu::StorageKey> AppInfo;
typedef bsl::pair<bsl::string, mqbu::StorageKey> AppInfo;
typedef bsl::unordered_map<bsl::string, mqbu::StorageKey> AppInfos;
typedef AppInfos::const_iterator AppInfosCIter;
typedef AppInfos::const_iterator AppInfosCIter;

struct QueueAssignmentResult {
enum Enum {
Expand Down Expand Up @@ -336,8 +336,7 @@ class ClusterStateManager {
virtual void
processQueueAssignmentAdvisory(const bmqp_ctrlmsg::ControlMessage& message,
mqbnet::ClusterNode* source,
bool delayed = false,
bool fromLeaderAdvisory = false) = 0;
bool delayed = false) = 0;

/// Process the queue unAssigned advisory in the specified `message`
/// received from the specified `source`.
Expand Down

0 comments on commit 852e459

Please sign in to comment.