You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2026/04/26 09:23:52 UTC

(skywalking-banyandb-client-proto) branch main updated: Sync proto definitions with BanyanDB main (schema-consistency Phase 1+) (#3)

This is an automated email from the ASF dual-hosted git repository.

wu-sheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb-client-proto.git


The following commit(s) were added to refs/heads/main by this push:
     new 7d0b0a5  Sync proto definitions with BanyanDB main (schema-consistency Phase 1+) (#3)
7d0b0a5 is described below

commit 7d0b0a5684812523325a30b2318a026870b45c8f
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Sun Apr 26 17:23:47 2026 +0800

    Sync proto definitions with BanyanDB main (schema-consistency Phase 1+) (#3)
---
 proto/banyandb/v1/banyandb-common.proto   |   2 +
 proto/banyandb/v1/banyandb-database.proto | 323 +++++++++++++++++++++++++++++-
 proto/banyandb/v1/banyandb-measure.proto  |  40 +++-
 proto/banyandb/v1/banyandb-model.proto    |   1 +
 proto/banyandb/v1/banyandb-schema.proto   | 103 ++++++++++
 proto/banyandb/v1/banyandb-stream.proto   |   7 +
 proto/banyandb/v1/banyandb-trace.proto    |   7 +
 7 files changed, 472 insertions(+), 11 deletions(-)

diff --git a/proto/banyandb/v1/banyandb-common.proto b/proto/banyandb/v1/banyandb-common.proto
index d4ace04..52ae8cc 100644
--- a/proto/banyandb/v1/banyandb-common.proto
+++ b/proto/banyandb/v1/banyandb-common.proto
@@ -118,6 +118,8 @@ message Group {
   ResourceOpts resource_opts = 3;
   // updated_at indicates when resources of the group are updated
   google.protobuf.Timestamp updated_at = 4;
+  // created_at is the first-appearance timestamp; survives updates unchanged.
+  google.protobuf.Timestamp created_at = 5;
 }
 
 // APIVersion is the version of the API
diff --git a/proto/banyandb/v1/banyandb-database.proto b/proto/banyandb/v1/banyandb-database.proto
index bd8242a..bf830b3 100644
--- a/proto/banyandb/v1/banyandb-database.proto
+++ b/proto/banyandb/v1/banyandb-database.proto
@@ -26,6 +26,26 @@ import "validate/validate.proto";
 import "banyandb/v1/banyandb-common.proto";
 import "banyandb/v1/banyandb-model.proto";
 
+enum Role {
+  ROLE_UNSPECIFIED = 0;
+  ROLE_META = 1;
+  ROLE_DATA = 2;
+  ROLE_LIAISON = 3;
+}
+
+message Node {
+  common.v1.Metadata metadata = 1;
+  repeated Role roles = 2;
+  string grpc_address = 3;
+  string http_address = 4;
+  google.protobuf.Timestamp created_at = 5;
+  // labels is a set of key-value pairs to describe the node.
+  map<string, string> labels = 6;
+  string property_repair_gossip_grpc_address = 7;
+  string property_schema_grpc_address = 8;
+  string property_schema_gossip_grpc_address = 9;
+}
+
 enum TagType {
   TAG_TYPE_UNSPECIFIED = 0;
   TAG_TYPE_STRING = 1;
@@ -57,6 +77,8 @@ message Stream {
   Entity entity = 3 [(validate.rules).message.required = true];
   // updated_at indicates when the stream is updated
   google.protobuf.Timestamp updated_at = 4;
+  // created_at is the first-appearance timestamp; survives updates unchanged.
+  google.protobuf.Timestamp created_at = 5;
 }
 
 message Entity {
@@ -117,6 +139,8 @@ message Measure {
   bool index_mode = 7;
   // sharding_key determines the distribution of TopN-related data.
   ShardingKey sharding_key = 8;
+  // created_at is the first-appearance timestamp; survives updates unchanged.
+  google.protobuf.Timestamp created_at = 9;
 }
 
 // TopNAggregation generates offline TopN statistics for a measure's TopN approximation
@@ -143,6 +167,8 @@ message TopNAggregation {
   int32 lru_size = 8;
   // updated_at indicates when the measure is updated
   google.protobuf.Timestamp updated_at = 9;
+  // created_at is the first-appearance timestamp; survives updates unchanged.
+  google.protobuf.Timestamp created_at = 10;
 }
 
 // IndexRule defines how to generate indices based on tags and the index type
@@ -178,6 +204,8 @@ message IndexRule {
   string analyzer = 5;
   // no_sort indicates whether the index is not for sorting.
   bool no_sort = 6;
+  // created_at is the first-appearance timestamp; survives updates unchanged.
+  google.protobuf.Timestamp created_at = 7;
 }
 
 // Subject defines which stream or measure would generate indices
@@ -206,6 +234,8 @@ message IndexRuleBinding {
   google.protobuf.Timestamp expire_at = 5 [(validate.rules).timestamp.required = true];
   // updated_at indicates when the IndexRuleBinding is updated
   google.protobuf.Timestamp updated_at = 6;
+  // created_at is the first-appearance timestamp; survives updates unchanged.
+  google.protobuf.Timestamp created_at = 7;
 }
 
 // Property stores the user defined data
@@ -216,6 +246,8 @@ message Property {
   repeated TagSpec tags = 2 [(validate.rules).repeated.min_items = 1];
   // updated_at indicates when the property is updated
   google.protobuf.Timestamp updated_at = 6;
+  // created_at is the first-appearance timestamp; survives updates unchanged.
+  google.protobuf.Timestamp created_at = 7;
 }
 
 // TraceTagSpec defines the specification of a tag in a trace.
@@ -243,6 +275,8 @@ message Trace {
   google.protobuf.Timestamp updated_at = 5;
   // span_id_tag_name is the name of the tag that stores the span ID.
   string span_id_tag_name = 6 [(validate.rules).string.min_len = 1];
+  // created_at is the first-appearance timestamp; survives updates unchanged.
+  google.protobuf.Timestamp created_at = 7;
 }
 
 message StreamRegistryServiceCreateRequest {
@@ -267,6 +301,10 @@ message StreamRegistryServiceDeleteRequest {
 
 message StreamRegistryServiceDeleteResponse {
   bool deleted = 1;
+  // delete_time is the server-assigned tombstone timestamp in unix nanos.
+  int64 delete_time = 2;
+  // mod_revision is the etcd revision of the tombstone; zero if the server did not record one.
+  int64 mod_revision = 3;
 }
 
 message StreamRegistryServiceGetRequest {
@@ -311,13 +349,19 @@ message IndexRuleBindingRegistryServiceCreateRequest {
   banyandb.database.v1.IndexRuleBinding index_rule_binding = 1;
 }
 
-message IndexRuleBindingRegistryServiceCreateResponse {}
+message IndexRuleBindingRegistryServiceCreateResponse {
+  // mod_revision is the etcd revision assigned by the server on successful create/update.
+  int64 mod_revision = 1;
+}
 
 message IndexRuleBindingRegistryServiceUpdateRequest {
   banyandb.database.v1.IndexRuleBinding index_rule_binding = 1;
 }
 
-message IndexRuleBindingRegistryServiceUpdateResponse {}
+message IndexRuleBindingRegistryServiceUpdateResponse {
+  // mod_revision is the etcd revision assigned by the server on successful create/update.
+  int64 mod_revision = 1;
+}
 
 message IndexRuleBindingRegistryServiceDeleteRequest {
   banyandb.common.v1.Metadata metadata = 1;
@@ -325,6 +369,10 @@ message IndexRuleBindingRegistryServiceDeleteRequest {
 
 message IndexRuleBindingRegistryServiceDeleteResponse {
   bool deleted = 1;
+  // delete_time is the server-assigned tombstone timestamp in unix nanos.
+  int64 delete_time = 2;
+  // mod_revision is the etcd revision of the tombstone; zero if the server did not record one.
+  int64 mod_revision = 3;
 }
 
 message IndexRuleBindingRegistryServiceGetRequest {
@@ -369,13 +417,19 @@ message IndexRuleRegistryServiceCreateRequest {
   banyandb.database.v1.IndexRule index_rule = 1;
 }
 
-message IndexRuleRegistryServiceCreateResponse {}
+message IndexRuleRegistryServiceCreateResponse {
+  // mod_revision is the etcd revision assigned by the server on successful create/update.
+  int64 mod_revision = 1;
+}
 
 message IndexRuleRegistryServiceUpdateRequest {
   banyandb.database.v1.IndexRule index_rule = 1;
 }
 
-message IndexRuleRegistryServiceUpdateResponse {}
+message IndexRuleRegistryServiceUpdateResponse {
+  // mod_revision is the etcd revision assigned by the server on successful create/update.
+  int64 mod_revision = 1;
+}
 
 message IndexRuleRegistryServiceDeleteRequest {
   banyandb.common.v1.Metadata metadata = 1;
@@ -383,6 +437,10 @@ message IndexRuleRegistryServiceDeleteRequest {
 
 message IndexRuleRegistryServiceDeleteResponse {
   bool deleted = 1;
+  // delete_time is the server-assigned tombstone timestamp in unix nanos.
+  int64 delete_time = 2;
+  // mod_revision is the etcd revision of the tombstone; zero if the server did not record one.
+  int64 mod_revision = 3;
 }
 
 message IndexRuleRegistryServiceGetRequest {
@@ -445,6 +503,10 @@ message MeasureRegistryServiceDeleteRequest {
 
 message MeasureRegistryServiceDeleteResponse {
   bool deleted = 1;
+  // delete_time is the server-assigned tombstone timestamp in unix nanos.
+  int64 delete_time = 2;
+  // mod_revision is the etcd revision of the tombstone; zero if the server did not record one.
+  int64 mod_revision = 3;
 }
 
 message MeasureRegistryServiceGetRequest {
@@ -489,20 +551,87 @@ message GroupRegistryServiceCreateRequest {
   banyandb.common.v1.Group group = 1;
 }
 
-message GroupRegistryServiceCreateResponse {}
+message GroupRegistryServiceCreateResponse {
+  // mod_revision is the etcd revision assigned by the server on successful create/update.
+  int64 mod_revision = 1;
+}
 
 message GroupRegistryServiceUpdateRequest {
   banyandb.common.v1.Group group = 1;
 }
 
-message GroupRegistryServiceUpdateResponse {}
+message GroupRegistryServiceUpdateResponse {
+  // mod_revision is the etcd revision assigned by the server on successful create/update.
+  int64 mod_revision = 1;
+}
 
+// GroupRegistryServiceDeleteRequest is the request for deleting a group.
 message GroupRegistryServiceDeleteRequest {
+  // group is the name of the group to delete.
+  string group = 1;
+  // dry_run indicates whether to perform a dry run without actually deleting data.
+  // When true, returns what would be deleted without making changes.
+  bool dry_run = 2;
+  // force indicates whether to force delete the group even if it contains data.
+  // When false, deletion will fail if the group is not empty.
+  bool force = 3;
+  // data_only indicates whether to delete only data files without removing metadata.
+  // When true, metadata are preserved.
+  bool data_only = 4;
+}
+
+// GroupRegistryServiceDeleteResponse is the response for deleting a group.
+message GroupRegistryServiceDeleteResponse {
+  // schema_info contains the schema resources that would be deleted (populated in dry-run mode).
+  SchemaInfo schema_info = 1;
+  // delete_time is the server-assigned tombstone timestamp in unix nanos.
+  int64 delete_time = 2;
+  // mod_revision is the etcd revision of the tombstone; zero if the server did not record one.
+  int64 mod_revision = 3;
+}
+
+// GroupDeletionTask represents the status of a group deletion operation.
+message GroupDeletionTask {
+  // Phase represents the current phase of the deletion task.
+  enum Phase {
+    PHASE_UNSPECIFIED = 0;
+    // PHASE_PENDING indicates the task is waiting to start.
+    PHASE_PENDING = 1;
+    // PHASE_IN_PROGRESS indicates the task is currently executing.
+    PHASE_IN_PROGRESS = 2;
+    // PHASE_COMPLETED indicates the task has completed successfully.
+    PHASE_COMPLETED = 3;
+    // PHASE_FAILED indicates the task has failed.
+    PHASE_FAILED = 4;
+  }
+  // current_phase is the current phase of the deletion task.
+  Phase current_phase = 1;
+  // total_counts maps resource types to their total count.
+  map<string, int32> total_counts = 2;
+  // deleted_counts maps resource types to the count of deleted resources.
+  map<string, int32> deleted_counts = 3;
+  // total_data_size_bytes is the total size of data to be deleted in bytes.
+  int64 total_data_size_bytes = 4;
+  // deleted_data_size_bytes is the size of data that has been deleted in bytes.
+  int64 deleted_data_size_bytes = 5;
+  // message provides additional information about the task status.
+  string message = 6;
+  // created_at is the timestamp when the task was created.
+  google.protobuf.Timestamp created_at = 7;
+  // updated_at is the timestamp when the task was last updated.
+  google.protobuf.Timestamp updated_at = 8;
+}
+
+// GroupRegistryServiceQueryRequest is the request for querying a group deletion task.
+message GroupRegistryServiceQueryRequest {
+  // group is the name of the group whose deletion task to query.
   string group = 1;
 }
 
-message GroupRegistryServiceDeleteResponse {
-  bool deleted = 1;
+// GroupRegistryServiceQueryResponse is the response for querying a group deletion task.
+message GroupRegistryServiceQueryResponse {
+  // task contains the status of the deletion task.
+  GroupDeletionTask task = 1;
 }
 
 message GroupRegistryServiceGetRequest {
@@ -527,6 +656,122 @@ message GroupRegistryServiceExistResponse {
   bool has_group = 1;
 }
 
+// GroupRegistryServiceInspectRequest is the request for inspecting a group's detailed information.
+message GroupRegistryServiceInspectRequest {
+  // group is the name of the group to inspect.
+  string group = 1;
+}
+
+// GroupRegistryServiceInspectResponse is the response for inspecting a group.
+message GroupRegistryServiceInspectResponse {
+  // group contains the group metadata.
+  banyandb.common.v1.Group group = 1;
+  // schema_info contains information about all schemas in the group.
+  SchemaInfo schema_info = 2;
+  // data_info contains data storage information for each node.
+  repeated DataInfo data_info = 3;
+  // liaison_info contains information about pending operations in liaison.
+  repeated LiaisonInfo liaison_info = 4;
+}
+
+// SchemaInfo contains information about all schema objects in a group.
+message SchemaInfo {
+  // streams is the list of stream names in the group.
+  repeated string streams = 1;
+  // measures is the list of measure names in the group.
+  repeated string measures = 2;
+  // traces is the list of trace names in the group.
+  repeated string traces = 3;
+  // properties is the list of property names in the group.
+  repeated string properties = 4;
+  // index_rules is the list of index rule names in the group.
+  repeated string index_rules = 5;
+  // index_rule_bindings is the list of index rule binding names in the group.
+  repeated string index_rule_bindings = 6;
+  // topn_aggregations is the list of TopN aggregation names in the group.
+  repeated string topn_aggregations = 7;
+}
+
+// DataInfo contains data storage information for a specific node.
+message DataInfo {
+  // node is the node that stores this data.
+  banyandb.database.v1.Node node = 1;
+  // segment_info contains information about each segment on this node.
+  repeated SegmentInfo segment_info = 2;
+  // data_size_bytes is the total size of data on this node in bytes.
+  int64 data_size_bytes = 3;
+}
+
+// SegmentInfo contains information about a specific time segment.
+message SegmentInfo {
+  // segment_id is the unique identifier of the segment.
+  string segment_id = 1;
+  // time_range_start is the start time of the segment.
+  string time_range_start = 2;
+  // time_range_end is the end time of the segment.
+  string time_range_end = 3;
+  // shard_info contains information about each shard in this segment.
+  repeated ShardInfo shard_info = 4;
+  // series_index_info contains information about the series index.
+  SeriesIndexInfo series_index_info = 5;
+}
+
+// ShardInfo contains information about a specific shard.
+message ShardInfo {
+  // shard_id is the unique identifier of the shard.
+  uint32 shard_id = 1;
+  // data_count is the number of data entries in this shard.
+  int64 data_count = 2;
+  // data_size_bytes is the size of data in this shard in bytes.
+  int64 data_size_bytes = 3;
+  // part_count is the number of parts in this shard.
+  int64 part_count = 4;
+  // inverted_index_info contains information about the inverted index.
+  InvertedIndexInfo inverted_index_info = 5;
+  // sidx_info contains information about sidx.
+  SIDXInfo sidx_info = 6;
+}
+
+// SeriesIndexInfo contains information about the series index.
+message SeriesIndexInfo {
+  // data_count is the number of entries in the series index.
+  int64 data_count = 1;
+  // data_size_bytes is the size of the series index in bytes.
+  int64 data_size_bytes = 2;
+}
+
+// InvertedIndexInfo contains information about the inverted index.
+message InvertedIndexInfo {
+  // data_count is the number of entries in the inverted index.
+  int64 data_count = 1;
+  // data_size_bytes is the size of the inverted index in bytes.
+  int64 data_size_bytes = 2;
+}
+
+// SIDXInfo contains information about sidx.
+message SIDXInfo {
+  // data_count is the number of entries in sidx.
+  int64 data_count = 1;
+  // data_size_bytes is the size of sidx in bytes.
+  int64 data_size_bytes = 2;
+  // part_count is the number of parts in sidx.
+  int64 part_count = 3;
+}
+
+// LiaisonInfo contains information about pending operations in liaison.
+message LiaisonInfo {
+  // pending_write_data_count is the number of data entries waiting to be written.
+  int64 pending_write_data_count = 1;
+  // pending_sync_part_count is the number of parts waiting to be synchronized.
+  int64 pending_sync_part_count = 2;
+  // pending_sync_data_size_bytes is the size of data waiting to be synchronized in bytes.
+  int64 pending_sync_data_size_bytes = 3;
+  // pending_handoff_part_count is the number of parts waiting for handoff.
+  int64 pending_handoff_part_count = 4;
+  // pending_handoff_data_size_bytes is the size of data waiting for handoff in bytes.
+  int64 pending_handoff_data_size_bytes = 5;
+}
+
 service GroupRegistryService {
   rpc Create(GroupRegistryServiceCreateRequest) returns (GroupRegistryServiceCreateResponse);
   rpc Update(GroupRegistryServiceUpdateRequest) returns (GroupRegistryServiceUpdateResponse);
@@ -538,19 +783,31 @@ service GroupRegistryService {
 
   // Exist doesn't expose an HTTP endpoint. Please use HEAD method to touch Get instead
   rpc Exist(GroupRegistryServiceExistRequest) returns (GroupRegistryServiceExistResponse);
+
+  // Inspect retrieves detailed information about a group including its schemas, data distribution, and pending operations.
+  rpc Inspect(GroupRegistryServiceInspectRequest) returns (GroupRegistryServiceInspectResponse);
+
+  // Query retrieves the status of a group deletion task.
+  rpc Query(GroupRegistryServiceQueryRequest) returns (GroupRegistryServiceQueryResponse);
 }
 
 message TopNAggregationRegistryServiceCreateRequest {
   banyandb.database.v1.TopNAggregation top_n_aggregation = 1;
 }
 
-message TopNAggregationRegistryServiceCreateResponse {}
+message TopNAggregationRegistryServiceCreateResponse {
+  // mod_revision is the etcd revision assigned by the server on successful create/update.
+  int64 mod_revision = 1;
+}
 
 message TopNAggregationRegistryServiceUpdateRequest {
   banyandb.database.v1.TopNAggregation top_n_aggregation = 1;
 }
 
-message TopNAggregationRegistryServiceUpdateResponse {}
+message TopNAggregationRegistryServiceUpdateResponse {
+  // mod_revision is the etcd revision assigned by the server on successful create/update.
+  int64 mod_revision = 1;
+}
 
 message TopNAggregationRegistryServiceDeleteRequest {
   banyandb.common.v1.Metadata metadata = 1;
@@ -558,6 +815,10 @@ message TopNAggregationRegistryServiceDeleteRequest {
 
 message TopNAggregationRegistryServiceDeleteResponse {
   bool deleted = 1;
+  // delete_time is the server-assigned tombstone timestamp in unix nanos.
+  int64 delete_time = 2;
+  // mod_revision is the etcd revision of the tombstone; zero if the server did not record one.
+  int64 mod_revision = 3;
 }
 
 message TopNAggregationRegistryServiceGetRequest {
@@ -639,6 +900,10 @@ message PropertyRegistryServiceDeleteRequest {
 
 message PropertyRegistryServiceDeleteResponse {
   bool deleted = 1;
+  // delete_time is the server-assigned tombstone timestamp in unix nanos.
+  int64 delete_time = 2;
+  // mod_revision is the etcd revision of the tombstone; zero if the server did not record one.
+  int64 mod_revision = 3;
 }
 
 message PropertyRegistryServiceGetRequest {
@@ -701,6 +966,10 @@ message TraceRegistryServiceDeleteRequest {
 
 message TraceRegistryServiceDeleteResponse {
   bool deleted = 1;
+  // delete_time is the server-assigned tombstone timestamp in unix nanos.
+  int64 delete_time = 2;
+  // mod_revision is the etcd revision of the tombstone; zero if the server did not record one.
+  int64 mod_revision = 3;
 }
 
 message TraceRegistryServiceGetRequest {
@@ -740,3 +1009,37 @@ service TraceRegistryService {
   // Exist doesn't expose an HTTP endpoint. Please use HEAD method to touch Get instead
   rpc Exist(TraceRegistryServiceExistRequest) returns (TraceRegistryServiceExistResponse);
 }
+
+message GetCurrentNodeRequest {}
+
+message GetCurrentNodeResponse {
+  banyandb.database.v1.Node node = 1;
+}
+
+service NodeQueryService {
+  rpc GetCurrentNode(GetCurrentNodeRequest) returns (GetCurrentNodeResponse) {}
+}
+
+message GetClusterStateRequest {}
+
+// RouteTable represents a collection of nodes grouped by their health state.
+// It provides a view of nodes that are registered, actively healthy, and those being evicted.
+message RouteTable {
+  // registered contains all nodes that have been discovered and registered in this route.
+  repeated banyandb.database.v1.Node registered = 1;
+  // active contains node names (Node.Metadata.Name) that are currently healthy and can handle requests.
+  repeated string active = 2;
+  // evictable contains node names (Node.Metadata.Name) that are unhealthy and being retried before eviction.
+  repeated string evictable = 3;
+}
+
+message GetClusterStateResponse {
+  // Liaison node: map's key could be "tire1" and "tire2". tire1 route traffic between liaison nodes, tire2 spread data among data nodes
+  // Data node: map's key could be "property" for gossip.
+  // Lifecycle agent: map's key could be the next stage's name.
+  map<string, RouteTable> route_tables = 1;
+}
+
+service ClusterStateService {
+  rpc GetClusterState(GetClusterStateRequest) returns (GetClusterStateResponse);
+}
diff --git a/proto/banyandb/v1/banyandb-measure.proto b/proto/banyandb/v1/banyandb-measure.proto
index f8c4f91..9385f80 100644
--- a/proto/banyandb/v1/banyandb-measure.proto
+++ b/proto/banyandb/v1/banyandb-measure.proto
@@ -51,6 +51,36 @@ message QueryResponse {
   repeated DataPoint data_points = 1;
   // trace contains the trace information of the query when trace is enabled
   common.v1.Trace trace = 2;
+  // group_statuses reports the per-group gate outcome. Populated even when the query
+  // short-circuits because any group failed the gate.
+  map<string, model.v1.Status> group_statuses = 50;
+}
+
+// InternalDataPoint wraps DataPoint with shard information for internal use.
+// Used in distributed query to distinguish data from different shards.
+message InternalDataPoint {
+  // The actual data point
+  DataPoint data_point = 1;
+  // The shard id where this data point comes from
+  uint32 shard_id = 2;
+}
+
+// InternalQueryRequest is the internal request for distributed query.
+// Wraps QueryRequest for extensibility.
+message InternalQueryRequest {
+  // The actual query request
+  QueryRequest request = 1;
+  // agg_return_partial when true asks data nodes to return aggregation partials (for reduce at liaison)
+  bool agg_return_partial = 2;
+}
+
+// InternalQueryResponse is the internal response for distributed query.
+// Contains shard information for proper deduplication.
+message InternalQueryResponse {
+  // data_points with shard information
+  repeated InternalDataPoint data_points = 1;
+  // trace contains the trace information of the query when trace is enabled
+  common.v1.Trace trace = 2;
 }
 
 // QueryRequest is the request contract for query.
@@ -111,14 +141,20 @@ message QueryRequest {
   bool trace = 13;
   // stages is used to specify the stage of the data points in the lifecycle
   repeated string stages = 14;
-  // rewriteAggTopNResult will rewrite agg result to raw data
+  // rewrite_agg_top_n_result will rewrite agg result to raw data
   bool rewrite_agg_top_n_result = 15;
+  // group_mod_revisions gates the query per group. Keys match entries in `groups`;
+  // values are the client's known mod_revision for that group. Empty map or value 0
+  // means "don't gate". A group not listed in the map is not gated.
+  map<string, int64> group_mod_revisions = 50;
 }
 
 
 
 service MeasureService {
   rpc Query(QueryRequest) returns (QueryResponse);
+  rpc InternalQuery(InternalQueryRequest) returns (InternalQueryResponse);
+
   rpc Write(stream WriteRequest) returns (stream WriteResponse);
   rpc TopN(TopNRequest) returns (TopNResponse);
 }
@@ -130,6 +166,8 @@ message TopNList {
   message Item {
     repeated model.v1.Tag entity = 1;
     model.v1.FieldValue value = 2;
+    int64 version = 3;
+    google.protobuf.Timestamp timestamp = 4;
   }
   // items contains top-n items in a list
   repeated Item items = 2;
diff --git a/proto/banyandb/v1/banyandb-model.proto b/proto/banyandb/v1/banyandb-model.proto
index e6066fc..97730e7 100644
--- a/proto/banyandb/v1/banyandb-model.proto
+++ b/proto/banyandb/v1/banyandb-model.proto
@@ -195,4 +195,5 @@ enum Status {
   STATUS_VERSION_UNSUPPORTED = 7; // Client version not supported
   STATUS_VERSION_DEPRECATED = 8; // Client version deprecated but still supported
   STATUS_METADATA_REQUIRED = 9; // Metadata is required for the first request
+  STATUS_SCHEMA_NOT_APPLIED = 10; // Client's ModRevision is ahead of the server cache; the server waited and timed out.
 }
diff --git a/proto/banyandb/v1/banyandb-schema.proto b/proto/banyandb/v1/banyandb-schema.proto
new file mode 100644
index 0000000..edd0fff
--- /dev/null
+++ b/proto/banyandb/v1/banyandb-schema.proto
@@ -0,0 +1,103 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+syntax = "proto3";
+
+option java_package = "org.apache.skywalking.banyandb.schema.v1";
+
+package banyandb.schema.v1;
+
+import "google/protobuf/duration.proto";
+
+// SchemaBarrierService lets clients block until the cluster's schema state has
+// caught up to a target. Standalone deployments answer from the single
+// in-process cache; distributed deployments fan out to every data node.
+service SchemaBarrierService {
+  // AwaitRevisionApplied blocks until every data node's local schema cache has
+  // observed mod_revision >= min_revision, or the timeout elapses.
+  rpc AwaitRevisionApplied(AwaitRevisionAppliedRequest) returns (AwaitRevisionAppliedResponse);
+  // AwaitSchemaApplied blocks until every data node reports all requested keys
+  // present at or above the per-key mod_revision.
+  rpc AwaitSchemaApplied(AwaitSchemaAppliedRequest) returns (AwaitSchemaAppliedResponse);
+  // AwaitSchemaDeleted blocks until every data node has removed all requested
+  // keys from its cache.
+  rpc AwaitSchemaDeleted(AwaitSchemaDeletedRequest) returns (AwaitSchemaDeletedResponse);
+}
+
+// SchemaKey identifies a schema resource by kind and name. Valid kind values:
+// "measure", "stream", "trace", "property", "index_rule",
+// "index_rule_binding", "group", "top_n_aggregation".
+message SchemaKey {
+  string kind = 1;
+  string group = 2;
+  string name = 3;
+}
+
+// NodeLaggard reports a single data node that has not caught up to the
+// requested schema state. missing_keys is populated by AwaitSchemaApplied
+// responses; still_present_keys is populated by AwaitSchemaDeleted responses.
+message NodeLaggard {
+  string node = 1;
+  int64 current_mod_revision = 2;
+  repeated SchemaKey missing_keys = 3;
+  repeated SchemaKey still_present_keys = 4;
+}
+
+// AwaitRevisionAppliedRequest carries the minimum mod_revision the caller is
+// waiting for and a wall-clock budget for the wait.
+message AwaitRevisionAppliedRequest {
+  int64 min_revision = 1;
+  google.protobuf.Duration timeout = 2;
+}
+
+// AwaitRevisionAppliedResponse reports whether every node reached the target
+// revision before the timeout, and lists laggards otherwise.
+message AwaitRevisionAppliedResponse {
+  bool applied = 1;
+  repeated NodeLaggard laggards = 2;
+}
+
+// AwaitSchemaAppliedRequest pairs each key with a per-key minimum revision.
+// keys is capped at 10000 server-side; exceeding the cap returns
+// InvalidArgument. A min_revisions entry of 0 means "just present, any
+// revision".
+message AwaitSchemaAppliedRequest {
+  repeated SchemaKey keys = 1;
+  repeated int64 min_revisions = 2;
+  google.protobuf.Duration timeout = 3;
+}
+
+// AwaitSchemaAppliedResponse reports whether every requested key is present at
+// or above its target revision on every node.
+message AwaitSchemaAppliedResponse {
+  bool applied = 1;
+  repeated NodeLaggard laggards = 2;
+}
+
+// AwaitSchemaDeletedRequest names the keys that must disappear from every
+// node's cache before the call returns.
+message AwaitSchemaDeletedRequest {
+  repeated SchemaKey keys = 1;
+  google.protobuf.Duration timeout = 2;
+}
+
+// AwaitSchemaDeletedResponse reports whether every node has removed the
+// requested keys.
+message AwaitSchemaDeletedResponse {
+  bool applied = 1;
+  repeated NodeLaggard laggards = 2;
+}
diff --git a/proto/banyandb/v1/banyandb-stream.proto b/proto/banyandb/v1/banyandb-stream.proto
index 642b189..f689ccd 100644
--- a/proto/banyandb/v1/banyandb-stream.proto
+++ b/proto/banyandb/v1/banyandb-stream.proto
@@ -51,6 +51,9 @@ message QueryResponse {
   repeated Element elements = 1;
   // trace contains the trace information of the query when trace is enabled
   common.v1.Trace trace = 2;
+  // group_statuses reports the per-group gate outcome. Populated even when the query
+  // short-circuits because any group failed the gate.
+  map<string, model.v1.Status> group_statuses = 50;
 }
 
 // QueryRequest is the request contract for query.
@@ -78,6 +81,10 @@ message QueryRequest {
   bool trace = 9;
   // stage is used to specify the stage of the query in the lifecycle
   repeated string stages = 10;
+  // group_mod_revisions gates the query per group. Keys match entries in `groups`;
+  // values are the client's known mod_revision for that group. Empty map or value 0
+  // means "don't gate". A group not listed in the map is not gated.
+  map<string, int64> group_mod_revisions = 50;
 }
 
 
diff --git a/proto/banyandb/v1/banyandb-trace.proto b/proto/banyandb/v1/banyandb-trace.proto
index b822b59..a05fa28 100644
--- a/proto/banyandb/v1/banyandb-trace.proto
+++ b/proto/banyandb/v1/banyandb-trace.proto
@@ -59,6 +59,9 @@ message QueryResponse {
   repeated Trace traces = 1;
   // trace_query_result contains the trace of the query execution if tracing is enabled.
   common.v1.Trace trace_query_result = 2;
+  // group_statuses reports the per-group gate outcome. Populated even when the query
+  // short-circuits because any group failed the gate.
+  map<string, model.v1.Status> group_statuses = 50;
 }
 
 // InternalQueryResponse is the response of an internal query.
@@ -93,6 +96,10 @@ message QueryRequest {
   bool trace = 9;
   // stage is used to specify the stage of the query in the lifecycle
   repeated string stages = 10;
+  // group_mod_revisions gates the query per group. Keys match entries in `groups`;
+  // values are the client's known mod_revision for that group. Empty map or value 0
+  // means "don't gate". A group not listed in the map is not gated.
+  map<string, int64> group_mod_revisions = 50;
 }