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:
2025-11-03 19:02:20 +00:00
parent e56bf76257
commit b1f1334e39
7 changed files with 884 additions and 1072 deletions

View File

@@ -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