acs::Cluster method update_node_info (public)

 <instance of acs::Cluster[i]> update_node_info

Defined in packages/acs-tcl/tcl/cluster-procs.tcl

Update cluster configuration when the when the configuration variables changed, or when nodes become available/unavailable after some time. Typically, this method is called via scheduled procedure every couple of seconds when clustering is enabled.

Testcases:
No testcase defined.
Source code:
set dynamic_peers [:dynamic_cluster_nodes]

if {!${:current_server_is_canonical_server}} {
    #
    # The current node might be a static or a dynamic
    # peer.  Do we have contact to the canonical_server?
    #
    if {![:reachable ${:canonicalServerLocation}]} {
        #
        # We lost contact to the canonical server. This is
        # for our server not a big problem, since all
        # other peer-to-peer updates will continue to
        # work.
        #
        # During downtime of the canonical server,
        # scheduled procedures (e.g. mail delivery) will
        # be interrupted, and no new servers can register.
        #
        ns_log warning "cluster node lost contact to "  "canonical server: ${:canonicalServerLocation}"
    }
    #
    # Are we an dynamic peer and not listed in
    # dynamic cluster nodes? This might happen in
    # situations, where the canonical server was
    # restarted (or separated for a while).
    #
    if {[:current_server_is_dynamic_cluster_peer]
        && ${:myLocation} ni $dynamic_peers
    } {
        ns_log warning "cluster node is not listed in dynamic peers."  "Must re-join canonical server: ${:canonicalServerLocation}"
        ns_log notice "... myLocation: ${:myLocation}"
        ns_log notice "... dynamic_peers: $dynamic_peers"
        :send_join_request_to_canonical_server
    }
}

#
# Update cluster_peer_nodes if necessary
#
set oldConfig [lsort [nsv_get cluster cluster_peer_nodes]]
set newConfig [lsort [:peer_nodes $dynamic_peers]]
if {$newConfig ne $oldConfig} {
    #
    # The cluster configuration has changed
    #
    ns_log notice "cluster config changed:\nOLD $oldConfig\nNEW $newConfig"
    nsv_set cluster cluster_peer_nodes $newConfig
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: