Add cluster replication features and membership management
- Introduced a new `ClusterManager` to handle cluster membership events and facilitate event replication across relay peers. - Implemented HTTP endpoints for retrieving the latest serial and fetching events within a specified range. - Enhanced event handling to process cluster membership events (Kind 39108) and update relay lists accordingly. - Updated configuration to support cluster administrators and their management capabilities. - Added comprehensive tests to validate the new cluster replication functionalities. - Documented the cluster replication protocol in a new specification file. - Bumped version to reflect these changes.
This commit is contained in:
@@ -53,6 +53,7 @@ type Server struct {
|
||||
spiderManager *spider.Spider
|
||||
syncManager *dsync.Manager
|
||||
relayGroupMgr *dsync.RelayGroupManager
|
||||
clusterManager *dsync.ClusterManager
|
||||
blossomServer *blossom.Server
|
||||
}
|
||||
|
||||
@@ -259,6 +260,13 @@ func (s *Server) UserInterface() {
|
||||
s.mux.HandleFunc("/blossom/", s.blossomHandler)
|
||||
log.Printf("Blossom blob storage API enabled at /blossom")
|
||||
}
|
||||
|
||||
// Cluster replication API endpoints
|
||||
if s.clusterManager != nil {
|
||||
s.mux.HandleFunc("/cluster/latest", s.clusterManager.HandleLatestSerial)
|
||||
s.mux.HandleFunc("/cluster/events", s.clusterManager.HandleEventsRange)
|
||||
log.Printf("Cluster replication API enabled at /cluster")
|
||||
}
|
||||
}
|
||||
|
||||
// handleFavicon serves orly-favicon.png as favicon.ico
|
||||
|
||||
Reference in New Issue
Block a user