[#329] node: Add async evacuate proto methods

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-05-02 18:40:54 +03:00 committed by Evgenii Stratonikov
parent 0fc494637f
commit 100b1b5128
6 changed files with 123 additions and 0 deletions

View file

@ -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")
}

Binary file not shown.

View file

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

Binary file not shown.

Binary file not shown.

Binary file not shown.