Do not change link state if Removing

inspect_established_receptor_connections should
not change link state is current state is Removing.

Other changes:
- rename inspect_execution_nodes to inspect_execution_and_hop_nodes
- Default link state is Adding
- Set min listener_port value to 1024
- inspect_established_receptor_connections now
runs as part of cluster_node_heartbeat task
This commit is contained in:
Seth Foster
2023-08-01 14:11:59 -04:00
committed by Seth Foster
parent 855f61a04e
commit 2bf6512a8e
6 changed files with 25 additions and 26 deletions

View File

@@ -688,8 +688,7 @@ def should_update_config(instances):
if key.endswith('-peer'):
current_peers.append(value['address'])
intended_peers = [f"{i.hostname}:{i.listener_port}" for i in instances]
# TODO remove this logging line
logger.warning(f"current {current_peers} intended {intended_peers}")
logger.debug(f"Peers current {current_peers} intended {intended_peers}")
if set(current_peers) == set(intended_peers):
return False # config file is already update to date
@@ -700,7 +699,7 @@ def generate_config_data():
# returns two values
# receptor config - based on current database peers
# should_update - If True, receptor_config differs from the receptor conf file on disk
instances = Instance.objects.filter(node_type__in=(Instance.Types.EXECUTION, Instance.Types.HOP), peers_from_control_nodes=True)
instances = Instance.objects.me().peers.all()
receptor_config = list(RECEPTOR_CONFIG_STARTER)
for instance in instances: