forked from TrueCloudLab/frostfs-node
[#329] node: Add async evacuate proto methods
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
df9e099fa7
commit
8523fd944e
6 changed files with 123 additions and 0 deletions
20
pkg/services/control/server/evacuate_async.go
Normal file
20
pkg/services/control/server/evacuate_async.go
Normal 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")
|
||||||
|
}
|
BIN
pkg/services/control/service.pb.go
generated
BIN
pkg/services/control/service.pb.go
generated
Binary file not shown.
|
@ -29,6 +29,15 @@ service ControlService {
|
||||||
// EvacuateShard moves all data from one shard to the others.
|
// EvacuateShard moves all data from one shard to the others.
|
||||||
rpc EvacuateShard (EvacuateShardRequest) returns (EvacuateShardResponse);
|
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.
|
// FlushCache moves all data from one shard to the others.
|
||||||
rpc FlushCache (FlushCacheRequest) returns (FlushCacheResponse);
|
rpc FlushCache (FlushCacheRequest) returns (FlushCacheResponse);
|
||||||
|
|
||||||
|
@ -298,3 +307,97 @@ message DoctorResponse {
|
||||||
Body body = 1;
|
Body body = 1;
|
||||||
Signature signature = 2;
|
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;
|
||||||
|
}
|
||||||
|
|
BIN
pkg/services/control/service_frostfs.pb.go
generated
BIN
pkg/services/control/service_frostfs.pb.go
generated
Binary file not shown.
BIN
pkg/services/control/service_grpc.pb.go
generated
BIN
pkg/services/control/service_grpc.pb.go
generated
Binary file not shown.
BIN
pkg/services/control/types.pb.go
generated
BIN
pkg/services/control/types.pb.go
generated
Binary file not shown.
Loading…
Reference in a new issue