feat(replication): define replication RPC API

Defines the rough outline of an replication RPC API. More details/docs
to follow.
pull/24376/head
Dom Dwyer 2023-01-04 17:37:32 +01:00
parent d4e890d01f
commit 91680854ce
No known key found for this signature in database
GPG Key ID: E4C40DBD9157879A
2 changed files with 81 additions and 0 deletions

View File

@ -58,6 +58,7 @@ fn generate_grpc_types(root: &Path) -> Result<()> {
ingester_path.join("query.proto"),
ingester_path.join("write_info.proto"),
ingester_path.join("write.proto"),
ingester_path.join("replication.proto"),
namespace_path.join("service.proto"),
object_store_path.join("service.proto"),
predicate_path.join("predicate.proto"),

View File

@ -0,0 +1,80 @@
syntax = "proto3";
package influxdata.iox.ingester.v1;
option go_package = "github.com/influxdata/iox/ingester/v1";
import "influxdata/pbdata/v1/influxdb_pb_data_protocol.proto";
// A service provided by Ingester2 instances, called by Ingester Replicas.
service PartitionBufferService {
// Acquire the full in-memory state of the recipient ingester, returning the
// data of all known partitions.
//
// This is NOT an atomic snapshot of the global in-memory state, but MUST be
// an atomic snapshot of a single partition's buffer state.
rpc GetPartitionBuffers(GetPartitionBuffersRequest) returns (stream GetPartitionBuffersResponse);
}
message GetPartitionBuffersRequest {}
message GetPartitionBuffersResponse {
// The unique, per-instance UUID of the ingester pushing this operation.
string ingester_uuid = 1;
// The catalog ID of this partition.
int64 partition_id = 2;
// The serialised roaring bitmap of Sequence Number values buffered in this
// data payload.
//
// Generated by calling croaring::Bitmap::serialize().
bytes croaring_sequence_number_bitmap = 3;
// The complete set of data buffered for this partition at the time this
// message was generated.
influxdata.pbdata.v1.DatabaseBatch payload = 4;
}
// A service provided by Ingester Replica instances to accept pushed events from
// an Ingester2 instance.
service ReplicationService {
// Push the provided write request to the replica.
rpc Replicate(ReplicateRequest) returns (ReplicateResponse);
// Notify the replica that a given range of sequence numbers within a
// partition has been persisted.
rpc PersistComplete(PersistCompleteRequest) returns (PersistCompleteResponse);
}
message ReplicateRequest {
// The unique, per-instance UUID of the ingester pushing this operation.
string ingester_uuid = 1;
// The catalog ID of this partition.
int64 partition_id = 2;
// The Sequence Number assigned to this operation.
//
// A tuple of (ingester_uuid, sequence_number) is always guaranteed to
// uniquely identify this operation.
int64 sequence_number = 3;
// The operation payload data.
influxdata.pbdata.v1.DatabaseBatch payload = 4;
}
message ReplicateResponse {}
message PersistCompleteRequest {
// The unique, per-instance UUID of the ingester pushing this operation.
string ingester_uuid = 1;
// The catalog ID of the partition that has had data persisted.
int64 partition_id = 2;
// The serialised roaring bitmap of Sequence Number values persisted.
//
// Generated by calling croaring::Bitmap::serialize().
bytes croaring_sequence_number_bitmap = 3;
}
message PersistCompleteResponse {}