Skip to content

Commit

Permalink
Boostrap persistent state for volume servers.
Browse files Browse the repository at this point in the history
This PR implements logic load/save persistent state information for storages
associated with volume servers, and reporting state changes back to masters
via heartbeat messages.

More work ensues!

See https://github.com/seaweedfs/seaweedfs/issues/7977 for details.
  • Loading branch information
Lisandro Pin committed Jan 7, 2026
1 parent e67973d commit 5148562
Show file tree
Hide file tree
Showing 10 changed files with 1,332 additions and 941 deletions.
5 changes: 5 additions & 0 deletions weed/pb/master.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package master_pb;

option go_package = "github.com/seaweedfs/seaweedfs/weed/pb/master_pb";

import "volume_server.proto";

//////////////////////////////////////////////////

service Seaweed {
Expand Down Expand Up @@ -84,6 +86,9 @@ message Heartbeat {
uint32 grpc_port = 20;
repeated string location_uuids = 21;
string id = 22; // volume server id, independent of ip:port for stable identification

// state flags
volume_server_pb.VolumeServerState state = 23;
}

message HeartbeatResponse {
Expand Down
185 changes: 99 additions & 86 deletions weed/pb/master_pb/master.pb.go

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions weed/pb/volume_server.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ import "remote.proto";

//////////////////////////////////////////////////

// Persistent state for volume servers.
message VolumeServerState {
// Whether the server is in maintenance (i.e. read-only) mode.
bool maintenance = 1;
}

//////////////////////////////////////////////////

service VolumeServer {
//Experts only: takes multiple fid parameters. This function does not propagate deletes to replicas.
rpc BatchDelete (BatchDeleteRequest) returns (BatchDeleteResponse) {
Expand Down Expand Up @@ -45,6 +53,7 @@ service VolumeServer {
}
rpc VolumeStatus (VolumeStatusRequest) returns (VolumeStatusResponse) {
}
// TODO(issues/7977): add RPCs to control state flags

// copy the .idx .dat files, and mount this volume
rpc VolumeCopy (VolumeCopyRequest) returns (stream VolumeCopyResponse) {
Expand Down Expand Up @@ -569,6 +578,7 @@ message VolumeServerStatusRequest {

}
message VolumeServerStatusResponse {
// TODO(issues/7977): add volume server state to response
repeated DiskStatus disk_statuses = 1;
MemStatus memory_status = 2;
string version = 3;
Expand Down
Loading

0 comments on commit 5148562

Please sign in to comment.