mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-26 10:25:05 +01:00
d50e553ebb
We assumed that `zfs recv -F FS` would basically replace FS inplace, leaving its children untouched. That is in fact not the case, it only works if `zfs send -R` is set, which we don't do. Thus, implement the required functionality manually. This solves a `zfs recv` error that would occur when a filesystem previously created as placeholder on the receiving side becomes a non-placeholder filesystem (likely due to config change on the sending side): zfs send pool1/foo@1 | zfs recv -F pool1/bar cannot receive new filesystem stream: destination has snapshots (eg. pool1/bar) must destroy them to overwrite it
132 lines
3.2 KiB
Protocol Buffer
132 lines
3.2 KiB
Protocol Buffer
syntax = "proto3";
|
|
option go_package = "pdu";
|
|
|
|
service Replication {
|
|
rpc Ping (PingReq) returns (PingRes);
|
|
rpc ListFilesystems (ListFilesystemReq) returns (ListFilesystemRes);
|
|
rpc ListFilesystemVersions (ListFilesystemVersionsReq) returns (ListFilesystemVersionsRes);
|
|
rpc DestroySnapshots (DestroySnapshotsReq) returns (DestroySnapshotsRes);
|
|
rpc ReplicationCursor (ReplicationCursorReq) returns (ReplicationCursorRes);
|
|
// for Send and Recv, see package rpc
|
|
}
|
|
|
|
message ListFilesystemReq {}
|
|
|
|
message ListFilesystemRes {
|
|
repeated Filesystem Filesystems = 1;
|
|
}
|
|
|
|
message Filesystem {
|
|
string Path = 1;
|
|
string ResumeToken = 2;
|
|
bool IsPlaceholder = 3;
|
|
}
|
|
|
|
message ListFilesystemVersionsReq {
|
|
string Filesystem = 1;
|
|
}
|
|
|
|
message ListFilesystemVersionsRes {
|
|
repeated FilesystemVersion Versions = 1;
|
|
}
|
|
|
|
message FilesystemVersion {
|
|
enum VersionType {
|
|
Snapshot = 0;
|
|
Bookmark = 1;
|
|
}
|
|
VersionType Type = 1;
|
|
string Name = 2;
|
|
uint64 Guid = 3;
|
|
uint64 CreateTXG = 4;
|
|
string Creation = 5; // RFC 3339
|
|
}
|
|
|
|
|
|
message SendReq {
|
|
string Filesystem = 1;
|
|
string From = 2;
|
|
// May be empty / null to request a full transfer of From
|
|
string To = 3;
|
|
|
|
// If ResumeToken is not empty, the resume token that CAN be tried for 'zfs send' by the sender.
|
|
// The sender MUST indicate in SendRes.UsedResumeToken
|
|
// If it does not work, the sender SHOULD clear the resume token on their side
|
|
// and use From and To instead
|
|
// If ResumeToken is not empty, the GUIDs of From and To
|
|
// MUST correspond to those encoded in the ResumeToken.
|
|
// Otherwise, the Sender MUST return an error.
|
|
string ResumeToken = 4;
|
|
bool Compress = 5;
|
|
bool Dedup = 6;
|
|
|
|
bool DryRun = 7;
|
|
}
|
|
|
|
message Property {
|
|
string Name = 1;
|
|
string Value = 2;
|
|
}
|
|
|
|
message SendRes {
|
|
// Whether the resume token provided in the request has been used or not.
|
|
bool UsedResumeToken = 2;
|
|
|
|
// Expected stream size determined by dry run, not exact.
|
|
// 0 indicates that for the given SendReq, no size estimate could be made.
|
|
int64 ExpectedSize = 3;
|
|
|
|
repeated Property Properties = 4;
|
|
}
|
|
|
|
message ReceiveReq {
|
|
string Filesystem = 1; // FIXME should be snapshot name, we can enforce that on recv
|
|
|
|
// If true, the receiver should clear the resume token before perfoming the zfs recv of the stream in the request
|
|
bool ClearResumeToken = 2;
|
|
}
|
|
|
|
message ReceiveRes {}
|
|
|
|
message DestroySnapshotsReq {
|
|
string Filesystem = 1;
|
|
// Path to filesystem, snapshot or bookmark to be destroyed
|
|
repeated FilesystemVersion Snapshots = 2;
|
|
}
|
|
|
|
message DestroySnapshotRes {
|
|
FilesystemVersion Snapshot = 1;
|
|
string Error = 2;
|
|
}
|
|
|
|
message DestroySnapshotsRes {
|
|
repeated DestroySnapshotRes Results = 1;
|
|
}
|
|
|
|
message ReplicationCursorReq {
|
|
string Filesystem = 1;
|
|
message GetOp {}
|
|
message SetOp {
|
|
string Snapshot = 2;
|
|
}
|
|
oneof op {
|
|
GetOp get = 2;
|
|
SetOp set = 3;
|
|
}
|
|
}
|
|
|
|
message ReplicationCursorRes {
|
|
oneof Result {
|
|
uint64 Guid = 1;
|
|
bool Notexist = 2;
|
|
}
|
|
}
|
|
|
|
message PingReq {
|
|
string Message = 1;
|
|
}
|
|
|
|
message PingRes {
|
|
// Echo must be PingReq.Message
|
|
string Echo = 1;
|
|
} |