diff --git a/pkg/services/control/server/evacuate_async.go b/pkg/services/control/server/evacuate_async.go new file mode 100644 index 00000000..94ddc73d --- /dev/null +++ b/pkg/services/control/server/evacuate_async.go @@ -0,0 +1,20 @@ +package control + +import ( + "context" + "fmt" + + "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/control" +) + +func (s *Server) StartShardEvacuation(context.Context, *control.StartShardEvacuationRequest) (*control.StartShardEvacuationResponse, error) { + return nil, fmt.Errorf("not implemented") +} + +func (s *Server) GetShardEvacuationStatus(context.Context, *control.GetShardEvacuationStatusRequest) (*control.GetShardEvacuationStatusResponse, error) { + return nil, fmt.Errorf("not implemented") +} + +func (s *Server) StopShardEvacuation(context.Context, *control.StopShardEvacuationRequest) (*control.StopShardEvacuationResponse, error) { + return nil, fmt.Errorf("not implemented") +} diff --git a/pkg/services/control/service.pb.go b/pkg/services/control/service.pb.go index a126ce16..b1bebb1e 100644 Binary files a/pkg/services/control/service.pb.go and b/pkg/services/control/service.pb.go differ diff --git a/pkg/services/control/service.proto b/pkg/services/control/service.proto index 32a87c74..ca35ae04 100644 --- a/pkg/services/control/service.proto +++ b/pkg/services/control/service.proto @@ -29,6 +29,15 @@ service ControlService { // EvacuateShard moves all data from one shard to the others. rpc EvacuateShard (EvacuateShardRequest) returns (EvacuateShardResponse); + // StartShardEvacuation starts moving all data from one shard to the others. + rpc StartShardEvacuation (StartShardEvacuationRequest) returns (StartShardEvacuationResponse); + + // GetShardEvacuationStatus returns evacuation status. + rpc GetShardEvacuationStatus (GetShardEvacuationStatusRequest) returns (GetShardEvacuationStatusResponse); + + // StopShardEvacuation stops moving all data from one shard to the others. + rpc StopShardEvacuation (StopShardEvacuationRequest) returns (StopShardEvacuationResponse); + // FlushCache moves all data from one shard to the others. rpc FlushCache (FlushCacheRequest) returns (FlushCacheResponse); @@ -298,3 +307,97 @@ message DoctorResponse { Body body = 1; Signature signature = 2; } + +// StartShardEvacuation request. +message StartShardEvacuationRequest { + // Request body structure. + message Body { + // IDs of the shards. + repeated bytes shard_ID = 1; + // Flag indicating whether object read errors should be ignored. + bool ignore_errors = 2; + } + + Body body = 1; + Signature signature = 2; +} + +// StartShardEvacuation response. +message StartShardEvacuationResponse { + // Response body structure. + message Body {} + + Body body = 1; + Signature signature = 2; +} + +// GetShardEvacuationStatus request. +message GetShardEvacuationStatusRequest { + // Request body structure. + message Body {} + + Body body = 1; + Signature signature = 2; +} + +// GetShardEvacuationStatus response. +message GetShardEvacuationStatusResponse { + // Response body structure. + message Body { + // Evacuate status enum. + enum Status { + EVACUATE_SHARD_STATUS_UNDEFINED = 0; + RUNNING = 1; + COMPLETED = 2; + } + + // Unix timestamp value. + message UnixTimestamp { + int64 value = 1; + } + + // Duration in seconds. + message Duration { + int64 seconds = 1; + } + + // Total objects to evacuate count. The value is approximate, so evacuated + failed == total is not guaranteed after completion. + uint64 total = 1; + // Evacuated objects count. + uint64 evacuated = 2; + // Failed objects count. + uint64 failed = 3; + + // Shard IDs. + repeated bytes shard_ID = 4; + // Evacuation process status. + Status status = 5; + // Evacuation process duration. + Duration duration = 6; + // Evacuation process started at timestamp. + UnixTimestamp started_at = 7; + // Error message if evacuation failed. + string error_message = 8; + } + + Body body = 1; + Signature signature = 2; +} + +// StopShardEvacuation request. +message StopShardEvacuationRequest { + // Request body structure. + message Body {} + + Body body = 1; + Signature signature = 2; +} + +// StopShardEvacuation response. +message StopShardEvacuationResponse { + // Response body structure. + message Body {} + + Body body = 1; + Signature signature = 2; +} diff --git a/pkg/services/control/service_frostfs.pb.go b/pkg/services/control/service_frostfs.pb.go index b9b865a9..979c2268 100644 Binary files a/pkg/services/control/service_frostfs.pb.go and b/pkg/services/control/service_frostfs.pb.go differ diff --git a/pkg/services/control/service_grpc.pb.go b/pkg/services/control/service_grpc.pb.go index 3fa1e54d..96642153 100644 Binary files a/pkg/services/control/service_grpc.pb.go and b/pkg/services/control/service_grpc.pb.go differ diff --git a/pkg/services/control/types.pb.go b/pkg/services/control/types.pb.go index 9d686475..d2ee5077 100644 Binary files a/pkg/services/control/types.pb.go and b/pkg/services/control/types.pb.go differ