1- import "ydb/core/protos/flat_tx_scheme .proto" ;
1+ import "ydb/core/scheme/ protos/pathid .proto" ;
22
33package NKikimrSchemeBoard ;
44option java_package = "ru.yandex.kikimr.proto" ;
@@ -13,22 +13,68 @@ message TEvHandshake {
1313 optional uint64 Generation = 2 ;
1414}
1515
16- // here and below
17- // Owner is the tablet id of schemeshard witch holds the records
18- // LocalPathId is a second part of TPathId
19- // PathOwnerId is a first part of TPathId
16+ // Here and below.
17+ // Owner is the tablet id of schemeshard which holds the records.
18+ // (PathOwnerId, LocalPathId) constitute TPathId of the object.
2019
20+ // TEvUpdate.DescribeSchemeResultSerialized is a NKikimrScheme.TEvDescribeSchemeResult
21+ // in the form of opaque payload.
22+ // Originally, that field existed as a properly typed TEvDescribeSchemeResult message.
23+ // However, that induce additional overhead to serialize and deserialize this message
24+ // when transfering over wire.
25+ // This performance cost is usually either negligible or imperceptible.
26+ // But in specific situations, particularly when rapidly updating partitioning information
27+ // for tables with huge number of shards, this overhead could lead to significant issues.
28+ // Schemeboard replicas could get overloaded and become unresponsive to further requests.
29+ // This is problematic, especially considering the schemeboard subsystem's critical role
30+ // in servicing all databases within a cluster, making it a Single Point of Failure (SPOF).
31+ //
32+ // The core realization is that the schemeboard components do not require the full content of
33+ // a TEvDescribeSchemeResult message to operate efficiently. Instead, only a limited set of
34+ // fields (path, path-id, version and info about subdomain/database) is required for processing.
35+ // And a whole TEvDescribeSchemeResult could be passed through as an opaque payload.
36+ //
37+ // Type change from TEvDescribeSchemeResult to bytes without changing field number
38+ // is a safe move. Actual value of the field remains unchanged at the wire protocol level.
39+ // Thus, older implementations will interpret the payload as a TEvDescribeSchemeResult message
40+ // and proceed with deserialization as usual. And newer implementations will recognize the data
41+ // as a binary blob and will deserialize it explicitly only when necessary.
42+ //
43+ // - Path
44+ // - PathOwnerId, LocalPathId
45+ // - PathDirEntryPathVersion
46+ // - PathSubdomainPathId
47+ // - PathAbandonedTenantsSchemeShards
48+ // are taken from the original TEvDescribeSchemeResult (one way or another).
49+ //
2150message TEvUpdate {
2251 optional uint64 Owner = 1 ;
2352 optional uint64 Generation = 2 ;
2453 optional TLocalPathIdRange DeletedLocalPathIds = 3 ;
25- optional string Path = 4 ;
26- optional uint64 LocalPathId = 5 ;
54+
55+ optional string Path = 4 ; // extracted from DescribeSchemeResult.Path
56+ optional uint64 LocalPathId = 5 ; // extracted from DescribeSchemeResult.PathId
57+
2758 optional bool IsDeletion = 6 [default = false ];
28- optional NKikimrScheme.TEvDescribeSchemeResult DescribeSchemeResult = 7 ;
59+
60+ optional bytes DescribeSchemeResultSerialized = 7 ;
61+
2962 optional bool NeedAck = 8 [default = false ];
30- optional uint64 PathOwnerId = 9 ;
63+
64+ optional uint64 PathOwnerId = 9 ; // extracted from DescribeSchemeResult.PathOwnerId, DescribeSchemeResult.PathDescription.Self.SchemeshardId in order of presence
65+
3166 optional TLocalPathIdRange MigratedLocalPathIds = 10 ;
67+
68+ // Explicit values extracted from DescribeSchemeResultSerialized
69+
70+ // DescribeSchemeResult.PathDescription.Self.PathVersion
71+ optional uint64 PathDirEntryPathVersion = 11 ;
72+
73+ // DescribeSchemeResult.PathDescription.DomainDescription.DomainKey
74+ optional NKikimrProto.TPathID PathSubdomainPathId = 13 ;
75+
76+ // DescribeSchemeResult.PathDescription.AbandonedTenantsSchemeShards
77+ repeated uint64 PathAbandonedTenantsSchemeShards = 14 ;
3278}
3379
3480message TEvUpdateAck {
@@ -65,16 +111,22 @@ message TEvUnsubscribe {
65111 optional uint64 LocalPathId = 3 ;
66112}
67113
114+ // See comments for TEvUpdate.
68115message TEvNotify {
69116 optional string Path = 1 ;
70117 // and/or
71118 optional uint64 PathOwnerId = 2 ;
72119 optional uint64 LocalPathId = 3 ;
73120 // common fields
74121 optional bool IsDeletion = 4 [default = false ];
75- optional NKikimrScheme.TEvDescribeSchemeResult DescribeSchemeResult = 5 ;
76- optional uint64 Version = 6 ;
122+
123+ optional bytes DescribeSchemeResultSerialized = 5 ;
124+
125+ optional uint64 Version = 6 ; // same as TEvUpdate.PathDirEntryPathVersion
77126 optional bool Strong = 7 [default = false ];
127+
128+ optional NKikimrProto.TPathID PathSubdomainPathId = 8 ;
129+ repeated uint64 PathAbandonedTenantsSchemeShards = 9 ;
78130}
79131
80132message TEvNotifyAck {
0 commit comments