Skip to content

Commit 5118ddf

Browse files
committed
remove reverse connection in integration tests
Signed-off-by: Emelia Lei <wlei29@bloomberg.net>
1 parent c0ef570 commit 5118ddf

File tree

4 files changed

+7
-144
lines changed

4 files changed

+7
-144
lines changed

src/groups/mqb/mqbcfg/mqbcfg.xsd

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -335,25 +335,16 @@
335335
myClusters.................:
336336
definition of the clusters the current machine is part of (if any);
337337
empty means this broker does not belong to any cluster
338-
myReverseClusters..........:
339-
name of the clusters (if any) the current machine is expected to
340-
receive inbound connections about and therefore should pro-actively
341-
create a proxy cluster at startup
342338
myVirtualClusters..........:
343339
information about all the virtual clusters the current machine is
344340
considered to belong to (if any)
345341
clusters...................: array of cluster definition
346-
reversedClusterConnections.:
347-
cluster and associated remote connections that should be
348-
established
349342
</documentation>
350343
</annotation>
351344
<sequence>
352345
<element name='myClusters' type='tns:ClusterDefinition' maxOccurs='unbounded'/>
353-
<element name='myReverseClusters' type='string' maxOccurs='unbounded'/>
354346
<element name='myVirtualClusters' type='tns:VirtualClusterInformation' maxOccurs='unbounded'/>
355347
<element name='proxyClusters' type='tns:ClusterProxyDefinition' maxOccurs='unbounded'/>
356-
<element name='reversedClusterConnections' type='tns:ReversedClusterConnection' maxOccurs='unbounded'/>
357348
</sequence>
358349
</complexType>
359350

@@ -830,19 +821,4 @@
830821
</sequence>
831822
</complexType>
832823

833-
<complexType name='ReversedClusterConnection'>
834-
<annotation>
835-
<documentation>
836-
Type representing the configuration for remote cluster connections..
837-
838-
name.............: name of the cluster
839-
connections......: list of connections to establish
840-
</documentation>
841-
</annotation>
842-
<sequence>
843-
<element name='name' type='string'/>
844-
<element name='connections' type='tns:ClusterNodeConnection' maxOccurs='unbounded'/>
845-
</sequence>
846-
</complexType>
847-
848824
</schema>

src/python/blazingmq/dev/configurator/__init__.py

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Broker:
6666
id: int
6767
config: mqbcfg.Configuration
6868
clusters: mqbcfg.ClustersDefinition = field(
69-
default_factory=lambda: mqbcfg.ClustersDefinition([], [], [], [], [])
69+
default_factory=lambda: mqbcfg.ClustersDefinition([], [], [])
7070
)
7171
domains: Dict[str, "Domain"] = field(default_factory=dict)
7272
proxy_clusters: Set[str] = field(default_factory=set)
@@ -126,7 +126,7 @@ def add_proxy_definition(self, cluster: "AbstractCluster"):
126126
)
127127
)
128128

129-
def proxy(self, target: Union[Domain, "AbstractCluster"], reverse: bool = False):
129+
def proxy(self, target: Union[Domain, "AbstractCluster"]):
130130
domains = [target] if isinstance(target, Domain) else target.domains.values()
131131
for domain in domains:
132132
cluster = domain.cluster
@@ -137,57 +137,6 @@ def proxy(self, target: Union[Domain, "AbstractCluster"], reverse: bool = False)
137137
if cluster.name not in self.proxy_clusters:
138138
self.add_proxy_definition(cluster)
139139

140-
if not reverse:
141-
continue
142-
143-
if cluster.name in self.clusters.my_reverse_clusters:
144-
continue
145-
146-
self.clusters.my_reverse_clusters.append(cluster.name)
147-
reverse_cluster = self.configurator.clusters[cluster.name]
148-
149-
for node in reverse_cluster.nodes.values():
150-
if reverse_cluster.name not in node.proxy_clusters:
151-
node.add_proxy_definition(reverse_cluster)
152-
153-
reversed_cluster_connections_found = False
154-
if node.clusters.reversed_cluster_connections is None:
155-
node.clusters.reversed_cluster_connections = []
156-
else:
157-
for (
158-
reversed_cluster_connections
159-
) in node.clusters.reversed_cluster_connections:
160-
if reversed_cluster_connections.name == reverse_cluster.name:
161-
reversed_cluster_connections_found = True
162-
break
163-
164-
if not reversed_cluster_connections_found:
165-
reversed_cluster_connections = mqbcfg.ReversedClusterConnection(
166-
reverse_cluster.name, []
167-
)
168-
node.clusters.reversed_cluster_connections.append(
169-
reversed_cluster_connections
170-
)
171-
172-
if self.listeners:
173-
for listener in self.listeners:
174-
print(listener)
175-
reversed_cluster_connections.connections.append(
176-
mqbcfg.ClusterNodeConnection(
177-
mqbcfg.TcpClusterNodeConnection(
178-
f"tcp://{self.host}:{listener.port}"
179-
)
180-
)
181-
)
182-
else:
183-
reversed_cluster_connections.connections.append(
184-
mqbcfg.ClusterNodeConnection(
185-
mqbcfg.TcpClusterNodeConnection(
186-
f"tcp://{self.host}:{self.port}"
187-
)
188-
)
189-
)
190-
191140
return self
192141

193142

src/python/blazingmq/dev/it/fixtures.py

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,6 @@ class ForwardProxyConnection(ProxyConnection):
511511
suffix = ""
512512

513513

514-
class ReverseProxyConnection:
515-
suffix = "_rev"
516-
517-
518514
WorkspaceConfigurator = Callable[..., None]
519515

520516

@@ -587,7 +583,6 @@ def multi_node_cluster_config(
587583
configurator: cfg.Configurator,
588584
port_allocator: Iterator[int],
589585
mode: Mode,
590-
reverse_proxy: bool = False,
591586
) -> None:
592587
mode.tweak(configurator.proto.cluster)
593588

@@ -613,7 +608,7 @@ def multi_node_cluster_config(
613608
tcp_host="localhost",
614609
tcp_port=next(port_allocator),
615610
data_center=data_center,
616-
).proxy(cluster, reverse=reverse_proxy)
611+
).proxy(cluster)
617612

618613

619614
multi_node_cluster_params = [
@@ -645,7 +640,6 @@ def multi_interface_cluster_config(
645640
port_allocator: Iterator[int],
646641
mode: Mode,
647642
listener_count: int,
648-
reverse_proxy: bool = False,
649643
) -> None:
650644
"""A factory for cluster configurations containing multiple open TCP interfaces.
651645
@@ -662,8 +656,6 @@ def multi_interface_cluster_config(
662656
mode: The cluster operation mode
663657
listener_count: The number of listeners that should be opened on a broker. The
664658
minimum number of listeners is 1.
665-
reverse_proxy: If True, configure reverse proxy brokers for the cluster.
666-
Otherwise, configure regular proxies for the cluster.
667659
"""
668660
mode.tweak(configurator.proto.cluster)
669661

@@ -699,7 +691,7 @@ def multi_interface_cluster_config(
699691
(f"listener{i}", next(port_allocator)) for i in range(listener_count)
700692
],
701693
data_center=data_center,
702-
).proxy(cluster, reverse=reverse_proxy)
694+
).proxy(cluster)
703695

704696

705697
multi_interface_cluster_params = [
@@ -739,7 +731,6 @@ def virtual_cluster_config(
739731
configurator: cfg.Configurator,
740732
port_allocator: Iterator[int],
741733
mode: Mode,
742-
reverse_proxy: bool = False,
743734
) -> None:
744735
mode.tweak(configurator.proto.cluster)
745736

@@ -778,7 +769,7 @@ def virtual_cluster_config(
778769
tcp_host="localhost",
779770
tcp_port=next(port_allocator),
780771
data_center=data_center,
781-
).proxy(cluster, reverse=reverse_proxy)
772+
).proxy(cluster)
782773

783774

784775
virtual_cluster_params = [
@@ -813,14 +804,13 @@ def cluster_config(request, config):
813804
###############################################################################
814805
# cluster fixture for all the combinations of three setups:
815806
# - connect via a virtual cluster
816-
# - cluster reverse connects to proxies
817807
# - use CSL mode
818808

819809

820810
cartesian_product_cluster_params = [
821811
pytest.param(
822-
functools.partial(config, mode=mode, reverse_proxy=rp_suffix != ""),
823-
id=f"{topology}{mode.suffix}{rp_suffix}",
812+
functools.partial(config, mode=mode),
813+
id=f"{topology}{mode.suffix}",
824814
marks=[
825815
pytest.mark.integrationtest,
826816
pytest.mark.pr_integrationtest,
@@ -833,7 +823,6 @@ def cluster_config(request, config):
833823
("virtual", virtual_cluster_config),
834824
)
835825
for mode in Mode.__members__.values()
836-
for rp_suffix in ("", "_rp")
837826
]
838827

839828

src/python/blazingmq/schemas/mqbcfg.py

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,32 +1563,6 @@ class NetworkInterfaces:
15631563
)
15641564

15651565

1566-
@dataclass
1567-
class ReversedClusterConnection:
1568-
"""Type representing the configuration for remote cluster connections..
1569-
1570-
name.............: name of the cluster
1571-
connections......: list of connections to establish
1572-
"""
1573-
1574-
name: Optional[str] = field(
1575-
default=None,
1576-
metadata={
1577-
"type": "Element",
1578-
"namespace": "http://bloomberg.com/schemas/mqbcfg",
1579-
"required": True,
1580-
},
1581-
)
1582-
connections: List[ClusterNodeConnection] = field(
1583-
default_factory=list,
1584-
metadata={
1585-
"type": "Element",
1586-
"namespace": "http://bloomberg.com/schemas/mqbcfg",
1587-
"min_occurs": 1,
1588-
},
1589-
)
1590-
1591-
15921566
@dataclass
15931567
class StatPluginConfig:
15941568
name: str = field(
@@ -2087,17 +2061,10 @@ class ClustersDefinition:
20872061
myClusters.................:
20882062
definition of the clusters the current machine is part of (if any);
20892063
empty means this broker does not belong to any cluster
2090-
myReverseClusters..........:
2091-
name of the clusters (if any) the current machine is expected to
2092-
receive inbound connections about and therefore should pro-actively
2093-
create a proxy cluster at startup
20942064
myVirtualClusters..........:
20952065
information about all the virtual clusters the current machine is
20962066
considered to belong to (if any)
20972067
clusters...................: array of cluster definition
2098-
reversedClusterConnections.:
2099-
cluster and associated remote connections that should be
2100-
established
21012068
"""
21022069

21032070
my_clusters: List[ClusterDefinition] = field(
@@ -2109,15 +2076,6 @@ class ClustersDefinition:
21092076
"min_occurs": 1,
21102077
},
21112078
)
2112-
my_reverse_clusters: List[str] = field(
2113-
default_factory=list,
2114-
metadata={
2115-
"name": "myReverseClusters",
2116-
"type": "Element",
2117-
"namespace": "http://bloomberg.com/schemas/mqbcfg",
2118-
"min_occurs": 1,
2119-
},
2120-
)
21212079
my_virtual_clusters: List[VirtualClusterInformation] = field(
21222080
default_factory=list,
21232081
metadata={
@@ -2136,15 +2094,6 @@ class ClustersDefinition:
21362094
"min_occurs": 1,
21372095
},
21382096
)
2139-
reversed_cluster_connections: List[ReversedClusterConnection] = field(
2140-
default_factory=list,
2141-
metadata={
2142-
"name": "reversedClusterConnections",
2143-
"type": "Element",
2144-
"namespace": "http://bloomberg.com/schemas/mqbcfg",
2145-
"min_occurs": 1,
2146-
},
2147-
)
21482097

21492098

21502099
@dataclass

0 commit comments

Comments
 (0)