Skip to content
Snippets Groups Projects
Commit 82bf99e4 authored by zphrs's avatar zphrs
Browse files

made rebroadcast conditional on whether engine is podman

parent 80b6c5cb
No related branches found
No related tags found
No related merge requests found
......@@ -118,8 +118,10 @@ class ClusterConductor:
for container in containers:
if container and container_regex.match(container):
self._dump_container_logs(dir, container)
def get_view(self) -> str:
return {"address": f"{self.ip}:{self.port}", "id": self.index}
def _dump_container_logs(self, dir, name: str) -> None:
log_file = os.path.join(dir, f"{name}.log")
self.log(f"Dumping logs for container {name} to file {log_file}")
......@@ -433,15 +435,18 @@ class ClusterConductor:
# update node ip
if container_ip != node.ip:
self.log(f"Warning: Node {i} IP addr changed from {node.ip} to {container_ip}")
self.log(
f"Warning: Node {i} IP addr changed from {node.ip} to {container_ip}"
)
node.ip = container_ip
if hasattr(self, "_parent"):
self._parent.clients[
node.index
].base_url = self.node_external_endpoint(node.index)
view_changed = True
# if view_changed and hasattr(self, "_parent"):
# self._parent.rebroadcast_view(self.get_shard_view())
if CONTAINER_ENGINE == "podman":
if hasattr(self, "_parent"):
self._parent.clients[
node.index
].base_url = self.node_external_endpoint(node.index)
view_changed = True
if CONTAINER_ENGINE == "podman" and view_changed and hasattr(self, "_parent"):
self._parent.rebroadcast_view(self.get_shard_view())
def create_partition(self, node_ids: List[int], partition_id: str) -> None:
net_name = f"kvs_{self.group_id}_net_{partition_id}"
......@@ -500,15 +505,18 @@ class ClusterConductor:
# update node ip
if container_ip != node.ip:
self.log(f"Warning: Node {i} IP addr changed from {node.ip} to {container_ip}")
self.log(
f"Warning: Node {i} IP addr changed from {node.ip} to {container_ip}"
)
node.ip = container_ip
if hasattr(self, "_parent"):
self._parent.clients[
node.index
].base_url = self.node_external_endpoint(node.index)
view_changed = True
# if view_changed and hasattr(self, "_parent"):
# self._parent.rebroadcast_view(self.get_shard_view())
if CONTAINER_ENGINE == "podman":
if hasattr(self, "_parent"):
self._parent.clients[
node.index
].base_url = self.node_external_endpoint(node.index)
view_changed = True
if CONTAINER_ENGINE == "podman" and view_changed and hasattr(self, "_parent"):
self._parent.rebroadcast_view(self.get_shard_view())
DeprecationWarning("View is in updated format")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment