diff --git a/generated_types/build.rs b/generated_types/build.rs index 0dc0575574..bd2c190598 100644 --- a/generated_types/build.rs +++ b/generated_types/build.rs @@ -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"), diff --git a/generated_types/protos/influxdata/iox/ingester/v1/replication.proto b/generated_types/protos/influxdata/iox/ingester/v1/replication.proto new file mode 100644 index 0000000000..3f795e28b0 --- /dev/null +++ b/generated_types/protos/influxdata/iox/ingester/v1/replication.proto @@ -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 {}