Index: openacs-4/packages/acs-admin/acs-admin.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/acs-admin.info,v
diff -u -r1.58.2.14 -r1.58.2.15
--- openacs-4/packages/acs-admin/acs-admin.info 4 Dec 2023 15:32:58 -0000 1.58.2.14
+++ openacs-4/packages/acs-admin/acs-admin.info 5 Dec 2023 17:14:58 -0000 1.58.2.15
@@ -9,7 +9,7 @@
f
t
-
+
Don Baccus
An interface for Site-wide administration of an OpenACS Installation.
2023-02-08
@@ -20,9 +20,9 @@
GPL
3
-
-
-
+
+
+
Index: openacs-4/packages/acs-admin/www/cluster.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/cluster.tcl,v
diff -u -r1.1.2.2 -r1.1.2.3
--- openacs-4/packages/acs-admin/www/cluster.tcl 4 Dec 2023 15:32:58 -0000 1.1.2.2
+++ openacs-4/packages/acs-admin/www/cluster.tcl 5 Dec 2023 17:14:58 -0000 1.1.2.3
@@ -11,24 +11,13 @@
set context [list $page_title]
set server_cluster_enabled_p [server_cluster_enabled_p]
-set dynamic_cluster_nodes [lsort [parameter::get -package_id $::acs::kernel_id -parameter DynamicClusterPeers]]
+set dynamic_cluster_nodes [::acs::cluster dynamic_cluster_nodes]
-
if {$drop_node ne ""} {
#
# Drop the provided node from DynamicClusterPeers
#
- set p [lsearch $dynamic_cluster_nodes $drop_node]
- if {$p != -1} {
- set cluster_nodes [lreplace $dynamic_cluster_nodes $p $p]
- parameter::set_value \
- -package_id $::acs::kernel_id \
- -parameter DynamicClusterPeers \
- -value $cluster_nodes
- } else {
- ns_log warning "cluster: provided node '$drop_node' is not in the" \
- "dynamic cluster configuration: $dynamic_cluster_nodes"
- }
+ acs::cluster drop_dynamic_node $drop_node
set done 1
} elseif {$flush_node ne ""} {
#
Index: openacs-4/packages/acs-kernel/acs-kernel.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/acs-kernel.info,v
diff -u -r1.150.2.59 -r1.150.2.60
--- openacs-4/packages/acs-kernel/acs-kernel.info 4 Dec 2023 15:32:58 -0000 1.150.2.59
+++ openacs-4/packages/acs-kernel/acs-kernel.info 5 Dec 2023 17:14:58 -0000 1.150.2.60
@@ -9,15 +9,15 @@
f
t
-
+
OpenACS Core Team
Routines and data models providing the foundation for OpenACS-based Web services.
2023-07-10
OpenACS
The OpenACS kernel contains the core datamodel create and drop scripts for such things as objects, groups, parties and the supporting PL/SQL and PL/pgSQL procedures.
3
-
+
@@ -33,6 +33,7 @@
+
Index: openacs-4/packages/acs-tcl/acs-tcl.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/acs-tcl.info,v
diff -u -r1.95.2.65 -r1.95.2.66
--- openacs-4/packages/acs-tcl/acs-tcl.info 4 Dec 2023 15:32:58 -0000 1.95.2.65
+++ openacs-4/packages/acs-tcl/acs-tcl.info 5 Dec 2023 17:14:58 -0000 1.95.2.66
@@ -9,7 +9,7 @@
f
t
-
+
OpenACS
The Kernel Tcl API library.
2023-05-15
@@ -18,9 +18,9 @@
GPL version 2
3
-
+
-
+
Index: openacs-4/packages/acs-tcl/tcl/cluster-init.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/cluster-init.tcl,v
diff -u -r1.1.2.10 -r1.1.2.11
--- openacs-4/packages/acs-tcl/tcl/cluster-init.tcl 4 Dec 2023 15:32:58 -0000 1.1.2.10
+++ openacs-4/packages/acs-tcl/tcl/cluster-init.tcl 5 Dec 2023 17:14:58 -0000 1.1.2.11
@@ -28,6 +28,7 @@
# Update the cluster info depending of the configured
# ClusterHeartbeatInterval to detect changed cluster
# configurations (maybe induced by missing reachability).
+ # This has to happen on all cluster nodes.
#
ad_schedule_proc -all_servers t \
[parameter::get \
@@ -37,6 +38,15 @@
::acs::cluster update_node_info
#
+ # Liveliness manager (running on the canonical server). It checks
+ # e.g. whether dynamic nodes should be deleted from the dynamic
+ # cluster nodes list automatically after some time of being not
+ # reachable.
+ #
+ ad_schedule_proc 5s ::acs::cluster check_state
+
+
+ #
# Setup of the listening URL
#
set url [::acs::cluster cget -url]
Index: openacs-4/packages/acs-tcl/tcl/cluster-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/cluster-procs.tcl,v
diff -u -r1.1.2.12 -r1.1.2.13
--- openacs-4/packages/acs-tcl/tcl/cluster-procs.tcl 4 Dec 2023 15:32:58 -0000 1.1.2.12
+++ openacs-4/packages/acs-tcl/tcl/cluster-procs.tcl 5 Dec 2023 17:14:58 -0000 1.1.2.13
@@ -300,6 +300,58 @@
}
}
+ :public method dynamic_cluster_nodes {} {
+ #
+ # Convenience function returning the list of dynamic
+ # cluster nodes.
+ #
+ return [parameter::get \
+ -package_id $::acs::kernel_id \
+ -parameter DynamicClusterPeers]
+ }
+
+ :public method drop_dynamic_node {node} {
+ #
+ # Drop the provided node from DynamicClusterPeers
+ #
+ set dynamic_cluster_nodes [:dynamic_cluster_nodes]
+ set p [lsearch $dynamic_cluster_nodes $node]
+ if {$p != -1} {
+ set cluster_nodes [lreplace $dynamic_cluster_nodes $p $p]
+ parameter::set_value \
+ -package_id $::acs::kernel_id \
+ -parameter DynamicClusterPeers \
+ -value $cluster_nodes
+ } else {
+ ns_log warning "cluster: can't drop node '$node': not in the" \
+ "dynamic cluster configuration: $dynamic_cluster_nodes"
+ }
+ }
+
+ :public method check_state {} {
+ #
+ # Check the livelyness of the dynamic cluster nodes. This
+ # method is intended to be run on the canonical server
+ # only, since it might update the DynamicClusterPeers via
+ # acs::clusterwide.
+ #
+ set autodeleteInterval [parameter::get \
+ -package_id $::acs::kernel_id \
+ -parameter ClusterAutodeleteInterval \
+ -default 2m]
+
+ foreach node [:dynamic_cluster_nodes] {
+ set last_contact [acs::cluster last_contact $node]
+ if {$last_contact ne ""} {
+ set seconds [expr {$last_contact/1000}]
+ if {[clock seconds]-($last_contact/1000) > [ns_baseunit -time $autodeleteInterval]} {
+ ns_log notice "[self] drop dynamic node $node due to ClusterAutodeleteInterval"
+ :drop_dynamic_node $node
+ }
+ }
+ }
+ }
+
:public method update_node_info {} {
#
# Update cluster configuration when the when the
@@ -310,9 +362,7 @@
# every couple of seconds when clustering is enabled.
#
- set dynamic_peers [parameter::get \
- -package_id $::acs::kernel_id \
- -parameter DynamicClusterPeers]
+ set dynamic_peers [:dynamic_cluster_nodes]
if {!${:current_server_is_canonical_server}} {
#
@@ -335,7 +385,7 @@
}
#
# Are we an dynamic peer and not listed in
- # DynamicClusterPeers? This might happen in
+ # dynamic cluster nodes? This might happen in
# situations, where the canonical server was
# restarted (or separated for a while).
#
@@ -643,13 +693,16 @@
# we know that the request is trustworthy.
#
ns_log notice "Cluster join_request $peerLocation accepted from $peerLocation"
- set dynamicClusterNodes [parameter::get -package_id $::acs::kernel_id -parameter DynamicClusterPeers]
+ set dynamicClusterNodes [:dynamic_cluster_nodes]
set dynamicClusterNodes [lsort -unique [concat $dynamicClusterNodes [:qualified_location $peerLocation]]]
#
# The parameter::set_value operation causes a
# clusterwide cache-flush for the parameters
#
- parameter::set_value -package_id $::acs::kernel_id -parameter DynamicClusterPeers -value $dynamicClusterNodes
+ parameter::set_value \
+ -package_id $::acs::kernel_id \
+ -parameter DynamicClusterPeers \
+ -value $dynamicClusterNodes
ns_log notice "[self] Cluster join_request leads to DynamicClusterPeers $dynamicClusterNodes"
}
return $success
@@ -708,10 +761,10 @@
# Configure base configuration values
#
#
- set dynamic_peers [parameter::get -package_id $::acs::kernel_id -parameter DynamicClusterPeers]
+ set dynamic_peers [:dynamic_cluster_nodes]
# At startup, when we are running on the canonical server,
- # check, whether the existing DynamicClusterPeers are
+ # check, whether the existing dynamic cluster nodes are
# still reachable. When the canonical server is started
# before the other cluster nodes, this parameter should be
# empty. However, when the canonical server is restarted,
@@ -745,8 +798,10 @@
# well.
#
:log "updating DynamicClusterPeers to $new_peer_locations"
- parameter::set_value -package_id $::acs::kernel_id -parameter DynamicClusterPeers \
- -value $new_peer_locations
+ parameter::set_value \
+ -package_id $::acs::kernel_id \
+ -parameter DynamicClusterPeers \
+ -value [lsort $new_peer_locations]
set dynamic_peers $new_peer_locations
}
}