Skip to content

Boostrap persistent state for volume servers. #1

Open
wants to merge 1 commit into
base: replay-7984-base-e67973d
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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