Files
scoutfs-manager/api/proto/sync/v1/sync.proto

85 lines
1.8 KiB
Protocol Buffer

syntax = "proto3";
package scoutfs.sync.v1;
option go_package = "github.com/scoutfs/scoutfs-manager/internal/app/scoutfs-manager/sync/syncpb";
import "google/protobuf/timestamp.proto";
// MetadataSyncService provides metadata replication between ScoutFS filesystems.
service MetadataSyncService {
// PushMetadata streams batches of inode metadata from source to target.
rpc PushMetadata(stream MetadataBatch) returns (PushMetadataResponse);
// SyncState returns the current sync watermarks for the given source.
rpc SyncState(SyncStateRequest) returns (SyncStateResponse);
}
message Timespec {
int64 sec = 1;
int64 nsec = 2;
}
message XattrEntry {
string name = 1;
bytes value = 2;
}
message DirEntry {
uint64 parent_ino = 1;
string name = 2;
uint32 d_type = 3;
}
message InodeMetadata {
uint64 ino = 1;
uint64 size = 2;
uint32 nlink = 3;
uint32 uid = 4;
uint32 gid = 5;
uint32 mode = 6;
uint64 rdev = 7;
uint64 meta_seq = 8;
uint64 data_seq = 9;
uint64 data_version = 10;
uint64 online_blocks = 11;
uint64 offline_blocks = 12;
Timespec atime = 13;
Timespec mtime = 14;
Timespec ctime = 15;
Timespec crtime = 16;
uint64 project_id = 17;
repeated XattrEntry xattrs = 18;
repeated string paths = 19;
repeated DirEntry dir_entries = 20;
bool deleted = 21;
}
message MetadataBatch {
repeated InodeMetadata inodes = 1;
uint64 source_committed_seq = 2;
string source_fsid = 3;
}
message PushMetadataResponse {
uint64 applied_count = 1;
uint64 error_count = 2;
repeated InodeError errors = 3;
}
message InodeError {
uint64 ino = 1;
string message = 2;
}
message SyncStateRequest {
string source_fsid = 1;
}
message SyncStateResponse {
uint64 last_synced_meta_seq = 1;
uint64 last_synced_data_seq = 2;
string source_fsid = 3;
google.protobuf.Timestamp last_sync_time = 4;
}