When seaweedfs/raft elects a new leader, transfer hashicorp raft leadership
to the same node. This ensures both raft systems always have the same leader,
allowing dual-write to work correctly.
Changes:
- Add SyncHashicorpRaftLeadership() to transfer hashicorp raft leadership
- Call sync on seaweedfs/raft leader change event
- Only the current hashicorp raft leader can initiate transfer
When using seaweedfs/raft (-raftHashicorp=false), also initialize hashicorp
raft in parallel. All state changes are written to both raft implementations,
keeping hashicorp raft in sync.
This enables seamless migration to hashicorp/raft:
- No manual steps required for existing deployments
- When ready, switch to -raftHashicorp=true and hashicorp raft already has
all the state
- The old seaweedfs/raft can be removed in a future version
Changes:
- NewRaftServer now initializes hashicorp raft in a subdirectory
- NextVolumeId writes to both raft implementations when both exist
- SetRaftServer sets both RaftServer and HashicorpRaft in topology
- Transport manager for hashicorp raft is registered for gRPC
* Added global http client
* Added Do func for global http client
* Changed the code to use the global http client
* Fix http client in volume uploader
* Fixed pkg name
* Fixed http util funcs
* Fixed http client for bench_filer_upload
* Fixed http client for stress_filer_upload
* Fixed http client for filer_server_handlers_proxy
* Fixed http client for command_fs_merge_volumes
* Fixed http client for command_fs_merge_volumes and command_volume_fsck
* Fixed http client for s3api_server
* Added init global client for main funcs
* Rename global_client to client
* Changed:
- fixed NewHttpClient;
- added CheckIsHttpsClientEnabled func
- updated security.toml in scaffold
* Reduce the visibility of some functions in the util/http/client pkg
* Added the loadSecurityConfig function
* Use util.LoadSecurityConfiguration() in NewHttpClient func
* Added context for the MasterClient's methods to avoid endless loops
* Returned WithClient function. Added WithClientCustomGetMaster function
* Hid unused ctx arguments
* Using a common context for the KeepConnectedToMaster and WaitUntilConnected functions
* Changed the context termination check in the tryConnectToMaster function
* Added a child context to the tryConnectToMaster function
* Added a common context for KeepConnectedToMaster and WaitUntilConnected functions in benchmark
* remove old raft servers if they don't answer to pings for too long
add ping durations as options
rename ping fields
fix some todos
get masters through masterclient
raft remove server from leader
use raft servers to ping them
CheckMastersAlive for hashicorp raft only
* prepare blocking ping
* pass waitForReady as param
* pass waitForReady through all functions
* waitForReady works
* refactor
* remove unneeded params
* rollback unneeded changes
* fix