From 44b4360ab8d2947d196709ca59efd9d23d5e3528 Mon Sep 17 00:00:00 2001 From: Yuan Jing Vincent Yan Date: Thu, 19 Sep 2024 10:07:23 -0400 Subject: [PATCH] mqbblp::ClusterCatalog: Check incompatibility between CSL and FSM modes (#421) Signed-off-by: Yuan Jing Vincent Yan --- src/groups/mqb/mqbblp/mqbblp_clustercatalog.cpp | 7 +++++++ src/groups/mqb/mqbmock/mqbmock_cluster.cpp | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/groups/mqb/mqbblp/mqbblp_clustercatalog.cpp b/src/groups/mqb/mqbblp/mqbblp_clustercatalog.cpp index 2f143e0d0..f7ebef940 100644 --- a/src/groups/mqb/mqbblp/mqbblp_clustercatalog.cpp +++ b/src/groups/mqb/mqbblp/mqbblp_clustercatalog.cpp @@ -153,6 +153,13 @@ int ClusterCatalog::createCluster(bsl::ostream& errorDescription, // 1. Fetch the cluster definition const mqbcfg::ClusterDefinition& clusterDefinition = *clusterDefinitionIter; + if (clusterDefinition.clusterAttributes().isFSMWorkflow() && + !clusterDefinition.clusterAttributes().isCSLModeEnabled()) { + errorDescription << "Cluster ('" << name + << "') has incompatible CSL and FSM modes, not " + "creating cluster."; + return (rc * 10) + rc_FETCH_DEFINITION_FAILED; // RETURN + } // 2. Create the mqbnet::Cluster rc = createNetCluster(errorDescription, diff --git a/src/groups/mqb/mqbmock/mqbmock_cluster.cpp b/src/groups/mqb/mqbmock/mqbmock_cluster.cpp index d7c62f326..743c5f558 100644 --- a/src/groups/mqb/mqbmock/mqbmock_cluster.cpp +++ b/src/groups/mqb/mqbmock/mqbmock_cluster.cpp @@ -89,6 +89,9 @@ void Cluster::_initializeClusterDefinition( BSLS_ASSERT_OPT(!d_isStarted && "_initializeClusterDefinition() must be called before" " start()"); + if (isFSMWorkflow) { + BSLS_ASSERT_SAFE(isCSLMode); + } d_clusterDefinition.name() = name;