Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(io-engine/api/cksum): add wipe checksum #55

Merged
merged 2 commits into from
Dec 8, 2023
Merged
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
32 changes: 28 additions & 4 deletions apis/io-engine/protobuf/v1/test.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ package mayastor.v1;

// Service to be used by test code, it is not meant to be used in production!
service TestRpc {
// Get all the features supported by the test service.
rpc GetFeatures (google.protobuf.Empty) returns (TestFeatures) {}

// Replica related methods.
//
// Wipe a replica using the selected method.
Expand All @@ -28,6 +31,13 @@ service TestRpc {
rpc ListFaultInjections (ListFaultInjectionsRequest) returns (ListFaultInjectionsReply) {}
}

message TestFeatures {
// Supported wipe methods.
repeated WipeOptions.WipeMethod wipe_methods = 1;
// Supported checksum algorithms.
repeated WipeOptions.CheckSumAlgorithm cksum_algs = 2;
}

message WipeReplicaRequest {
// Uuid of the replica.
string uuid = 1;
Expand All @@ -43,19 +53,28 @@ message WipeReplicaRequest {
message WipeOptions {
enum WipeMethod {
// Don't actually wipe, just pretend.
NONE = 0;
NONE = 0;
// Wipe by writing zeroes.
WRITE_ZEROES = 1;
WRITE_ZEROES = 1;
// Wipe by sending unmap/trim.
UNMAP = 2;
UNMAP = 2;
// Wipe by writing a given patter (see write_pattern(6) field).
WRITE_PATTERN = 3;
WRITE_PATTERN = 3;
// Checksum the bdev.
CHECKSUM = 4;
}
// Method used to wipe the bdev.
WipeMethod wipe_method = 1;
// When using WRITE_PATTERN, wipe using this 32bit write pattern
// Default: 0xDEADBEEF.
optional uint32 write_pattern = 2;

enum CheckSumAlgorithm {
// The CRC32C is a variant of CRC32.
Crc32c = 0;
}
// When using CHECKSUM, use the following algorithm.
CheckSumAlgorithm cksum_alg = 3;
}

message StreamWipeOptions {
Expand Down Expand Up @@ -88,6 +107,11 @@ message WipeReplicaResponse {
uint64 remaining_bytes = 8;
// Duration since the start of the wipe.
google.protobuf.Duration since = 9;
// When using CHECKSUM, output of the algorithm.
oneof checksum {
// 32bit CRC.
uint32 crc32 = 10;
}
}

message FaultInjection {
Expand Down
7 changes: 4 additions & 3 deletions apis/io-engine/src/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,10 @@ pub mod test {
pub use super::pb::{
test_rpc_client::TestRpcClient,
test_rpc_server::{TestRpc, TestRpcServer},
wipe_options, wipe_replica_request, AddFaultInjectionRequest, FaultInjection,
ListFaultInjectionsReply, ListFaultInjectionsRequest, RemoveFaultInjectionRequest,
StreamWipeOptions, WipeOptions, WipeReplicaRequest, WipeReplicaResponse,
wipe_options, wipe_replica_request, wipe_replica_response, AddFaultInjectionRequest,
FaultInjection, ListFaultInjectionsReply, ListFaultInjectionsRequest,
RemoveFaultInjectionRequest, StreamWipeOptions, TestFeatures, WipeOptions,
WipeReplicaRequest, WipeReplicaResponse,
};
}

Expand Down
Loading