2023-01-03 13:53:48 +01:00
|
|
|
syntax = "proto3";
|
|
|
|
package wal_log;
|
|
|
|
|
2024-01-10 09:49:34 -05:00
|
|
|
import "metadata.proto";
|
|
|
|
|
2023-01-03 13:53:48 +01:00
|
|
|
message LogOffset {
|
2023-05-29 15:08:45 +02:00
|
|
|
uint64 next_offset = 1;
|
2023-01-03 13:53:48 +01:00
|
|
|
}
|
|
|
|
|
2023-11-02 16:25:34 +01:00
|
|
|
message HelloRequest {
|
|
|
|
optional uint64 handshake_version = 1;
|
|
|
|
}
|
2023-02-07 10:01:13 +01:00
|
|
|
|
|
|
|
message HelloResponse {
|
2023-11-02 16:25:34 +01:00
|
|
|
/// Uuid of the current generation
|
|
|
|
string generation_id = 1;
|
|
|
|
/// First frame_no in the current generation
|
|
|
|
uint64 generation_start_index = 2;
|
2023-10-24 12:19:36 +02:00
|
|
|
/// id of the replicated log
|
2023-10-19 09:02:30 +02:00
|
|
|
string log_id = 3;
|
2023-10-24 12:19:36 +02:00
|
|
|
/// string-encoded Uuid v4 token for the current session, changes on each restart, and must be passed in subsequent requests header.string
|
|
|
|
/// If the header session token fails to match the current session token, a NO_HELLO error is returned
|
|
|
|
bytes session_token = 4;
|
2023-11-07 17:57:16 +01:00
|
|
|
optional uint64 current_replication_index = 5;
|
2024-01-10 09:49:34 -05:00
|
|
|
metadata.DatabaseConfig config = 6;
|
2023-02-07 10:01:13 +01:00
|
|
|
}
|
|
|
|
|
2023-01-03 13:53:48 +01:00
|
|
|
message Frame {
|
2023-01-20 16:28:38 +01:00
|
|
|
bytes data = 1;
|
2023-12-26 11:16:16 +01:00
|
|
|
// if this frames is a commit frame, then this can be set
|
|
|
|
// to the time when the transaction was commited
|
|
|
|
optional int64 timestamp = 2;
|
2023-01-03 13:53:48 +01:00
|
|
|
}
|
|
|
|
|
2023-08-07 12:58:11 -04:00
|
|
|
message Frames {
|
|
|
|
repeated Frame frames = 1;
|
|
|
|
}
|
|
|
|
|
2023-02-13 17:36:49 +01:00
|
|
|
service ReplicationLog {
|
2023-02-07 10:01:13 +01:00
|
|
|
rpc Hello(HelloRequest) returns (HelloResponse) {}
|
2023-01-20 16:28:38 +01:00
|
|
|
rpc LogEntries(LogOffset) returns (stream Frame) {}
|
2023-08-07 12:58:11 -04:00
|
|
|
rpc BatchLogEntries(LogOffset) returns (Frames) {}
|
2023-03-10 12:40:37 +01:00
|
|
|
rpc Snapshot(LogOffset) returns (stream Frame) {}
|
2023-01-03 13:53:48 +01:00
|
|
|
}
|