Skip to content

Commit

Permalink
feat(io-engine/api/cksum): add wipe checksum
Browse files Browse the repository at this point in the history
Checksums a replica which can be used to verify data between volume replicas.
For speed sake we're reusing the existing wipe replicas as it's a very good
fit for this and we can reuse the entire infra around it.
todo: consider renaming wipe etc

Signed-off-by: Tiago Castro <[email protected]>
  • Loading branch information
tiagolobocastro committed Dec 7, 2023
1 parent b591fb0 commit 2757a85
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
22 changes: 18 additions & 4 deletions apis/io-engine/protobuf/v1/test.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,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 +97,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 @@ -109,9 +109,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, WipeOptions, WipeReplicaRequest,
WipeReplicaResponse,
};
}

Expand Down

0 comments on commit 2757a85

Please sign in to comment.