actordb-protocol 0.7.0

Language-neutral peer and application wire contracts for ActorDB
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
// This file is @generated by prost-build.
/// Handshake: identifies the connecting node
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Hello {
    #[prost(string, tag = "1")]
    pub node_id: ::prost::alloc::string::String,
    /// Retained at its original field number for safe protobuf field evolution.
    /// Since protocol v2 this field must be empty; the challenge-bound proof is
    /// carried in HelloAuth.
    #[prost(bytes = "vec", tag = "2")]
    pub auth_tag: ::prost::alloc::vec::Vec<u8>,
    /// Inclusive wire-version range understood by this peer. Both are nonzero;
    /// a connection proceeds only when the ranges overlap.
    #[prost(uint32, tag = "3")]
    pub min_protocol_version: u32,
    #[prost(uint32, tag = "4")]
    pub max_protocol_version: u32,
    /// Feature bitset. Required bits are checked before either side installs the
    /// connection, so mixed binaries fail closed rather than mis-acknowledging
    /// mutations or replication.
    #[prost(uint64, tag = "5")]
    pub capabilities: u64,
    /// Fresh 256-bit challenge generated independently for every physical
    /// connection. Both peers' complete Hellos are bound into each HelloAuth.
    #[prost(bytes = "vec", tag = "6")]
    pub challenge: ::prost::alloc::vec::Vec<u8>,
}
/// Second handshake flight. With a configured cluster secret, auth_tag is an
/// HMAC-SHA256 over the ordered dialer/listener Hello transcript and the
/// proving role. Without a secret it is empty, but the flight still makes
/// handshake completion explicit before either peer publishes the connection.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HelloAuth {
    #[prost(bytes = "vec", tag = "1")]
    pub auth_tag: ::prost::alloc::vec::Vec<u8>,
}
/// A single replicated write, sent from a fragment's coordinator to the
/// other replica holders. Delivery is at-least-once; receivers merge with
/// last-writer-wins on (timestamp_ms, node_id) and do NOT re-forward.
/// `seq`/`boot_id` are propagation metadata.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReplicateOp {
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "2")]
    pub value: ::prost::alloc::vec::Vec<u8>,
    #[prost(uint64, tag = "3")]
    pub timestamp_ms: u64,
    #[prost(string, tag = "4")]
    pub node_id: ::prost::alloc::string::String,
    #[prost(uint64, tag = "5")]
    pub seq: u64,
    /// Random per process start. Carried as origin metadata; replay safety is
    /// provided by the value's LWW version rather than transport deduplication.
    #[prost(uint64, tag = "6")]
    pub boot_id: u64,
    /// Optional key expiry (wall-clock ms). 0/absent = no expiry.
    #[prost(uint64, tag = "7")]
    pub expires_at_ms: u64,
    /// True if this is a deletion tombstone.
    #[prost(bool, tag = "8")]
    pub is_tombstone: bool,
    #[prost(uint64, tag = "9")]
    pub logical_counter: u64,
}
/// A client-routed write: "you own this key's fragment — apply it as
/// coordinator and replicate to the other holders." One network hop.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ForwardedPut {
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "2")]
    pub value: ::prost::alloc::vec::Vec<u8>,
    #[prost(uint64, tag = "3")]
    pub timestamp_ms: u64,
    #[prost(string, tag = "4")]
    pub node_id: ::prost::alloc::string::String,
    #[prost(uint64, tag = "5")]
    pub seq: u64,
    #[prost(uint64, tag = "6")]
    pub boot_id: u64,
    /// Optional key expiry (wall-clock ms). 0/absent = no expiry.
    #[prost(uint64, tag = "7")]
    pub expires_at_ms: u64,
    /// True if this is a deletion tombstone.
    #[prost(bool, tag = "8")]
    pub is_tombstone: bool,
    /// Phase 7: priority the receiving node should apply this op with.
    #[prost(enumeration = "Priority", tag = "9")]
    pub priority: i32,
    /// Phase 8: re-forward count. A node that receives a ForwardedPut for a
    /// fragment it no longer serves (stale placement maps during
    /// migration) re-forwards it to the current owner instead of
    /// dropping it; hops bounds the chain.
    #[prost(uint32, tag = "10")]
    pub hops: u32,
    /// Correlates the exact apply outcome back to the originating node.
    #[prost(uint64, tag = "11")]
    pub req_id: u64,
    /// Optional encoded WriteConcernPolicy. Absence preserves local acknowledgement.
    #[prost(bytes = "vec", optional, tag = "12")]
    pub write_concern: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
    #[prost(uint64, tag = "13")]
    pub logical_counter: u64,
}
/// A single-key routed read. The origin tries configured holders in order; a
/// non-serving holder may relay it under a fresh request id while placement
/// maps converge. GetResponse has no unavailable value, so routing/actor
/// unavailability produces no false not-found reply and the origin times out.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ForwardedGet {
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    #[prost(uint64, tag = "2")]
    pub req_id: u64,
    /// Phase 7: priority the receiving node should serve this read with.
    #[prost(enumeration = "Priority", tag = "3")]
    pub priority: i32,
    /// Phase 8: re-forward count, as with ForwardedPut. A non-serving node
    /// relays the read to the current owner and relays the response back.
    #[prost(uint32, tag = "4")]
    pub hops: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetResponse {
    #[prost(uint64, tag = "1")]
    pub req_id: u64,
    #[prost(bool, tag = "2")]
    pub found: bool,
    #[prost(bytes = "vec", tag = "3")]
    pub value: ::prost::alloc::vec::Vec<u8>,
    #[prost(uint64, tag = "4")]
    pub timestamp_ms: u64,
    #[prost(string, tag = "5")]
    pub node_id: ::prost::alloc::string::String,
    /// Optional key expiry (wall-clock ms). 0/absent = no expiry.
    #[prost(uint64, tag = "6")]
    pub expires_at_ms: u64,
    /// True if this is a deletion tombstone.
    #[prost(bool, tag = "7")]
    pub is_tombstone: bool,
    /// Phase 7: true if the read was shed due to backpressure (distinct
    /// from not-found).
    #[prost(bool, tag = "8")]
    pub shed: bool,
    #[prost(uint64, tag = "9")]
    pub logical_counter: u64,
}
/// Retired protocol-v1/v2 full-state frames. They remain generated for source
/// compatibility, but a protocol-v3 connection closes if either is received.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncRequest {
    #[prost(uint32, repeated, tag = "1")]
    pub fragments: ::prost::alloc::vec::Vec<u32>,
}
/// Retired peer full-state response; see SyncRequest above.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SyncResponse {
    #[prost(message, repeated, tag = "1")]
    pub entries: ::prost::alloc::vec::Vec<SyncEntry>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncEntry {
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "2")]
    pub value: ::prost::alloc::vec::Vec<u8>,
    #[prost(uint64, tag = "3")]
    pub timestamp_ms: u64,
    #[prost(string, tag = "4")]
    pub node_id: ::prost::alloc::string::String,
    /// Optional key expiry (wall-clock ms). 0/absent = no expiry.
    #[prost(uint64, tag = "5")]
    pub expires_at_ms: u64,
    /// True if this is a deletion tombstone.
    #[prost(bool, tag = "6")]
    pub is_tombstone: bool,
    #[prost(uint64, tag = "7")]
    pub logical_counter: u64,
}
/// Top-level wire envelope, length-delimited on the wire
/// Phase 5: async sender/receiver replication. The sender batches ops per
/// (fragment, peer) and ships them on a timer. Tracked batches receive an ACK
/// reporting the achieved durability after apply and any requested flush attempt,
/// or a NACK on execution failure; reconciliation batches are untracked.
/// Session ids distinguish pairings
/// across reconnects; stale batches (old session) are discarded.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SessionStart {
    #[prost(uint64, tag = "1")]
    pub session_id: u64,
    #[prost(uint32, tag = "2")]
    pub fragment: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReplicateBatch {
    #[prost(uint64, tag = "1")]
    pub session_id: u64,
    #[prost(uint64, tag = "2")]
    pub batch_seq: u64,
    #[prost(uint32, tag = "3")]
    pub fragment: u32,
    #[prost(message, repeated, tag = "4")]
    pub ops: ::prost::alloc::vec::Vec<ReplicateOp>,
    /// Minimum fence the sender requires before this tracked batch may retire.
    /// Ignored for untracked reconciliation batches.
    #[prost(enumeration = "ReplicationAckLevel", tag = "5")]
    pub required_ack_level: i32,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BatchAck {
    #[prost(uint64, tag = "1")]
    pub session_id: u64,
    #[prost(uint64, tag = "2")]
    pub batch_seq: u64,
    #[prost(uint32, tag = "3")]
    pub fragment: u32,
    /// Distinguishes volatile in-memory application from a successful flush to
    /// the receiver's configured KvStore.
    #[prost(enumeration = "ReplicationAckLevel", tag = "4")]
    pub level: i32,
}
/// A receiver could not account for or persist a batch. The sender retains
/// and retries the exact idempotent operations instead of treating them as
/// delivered.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BatchNack {
    #[prost(uint64, tag = "1")]
    pub session_id: u64,
    #[prost(uint64, tag = "2")]
    pub batch_seq: u64,
    #[prost(uint32, tag = "3")]
    pub fragment: u32,
    #[prost(string, tag = "4")]
    pub error: ::prost::alloc::string::String,
}
/// Incremental anti-entropy: exchange version and content-digest summaries,
/// then only the divergent keys.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct KeySummary {
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    #[prost(uint64, tag = "2")]
    pub timestamp_ms: u64,
    #[prost(string, tag = "3")]
    pub node_id: ::prost::alloc::string::String,
    #[prost(bool, tag = "4")]
    pub is_tombstone: bool,
    #[prost(uint64, tag = "5")]
    pub logical_counter: u64,
    /// Exactly 32 bytes: SHA-256 over canonical payload and optional TTL deadline.
    #[prost(bytes = "vec", tag = "6")]
    pub content_digest: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReconcileRequest {
    #[prost(uint32, tag = "1")]
    pub fragment: u32,
    /// Correlates the request to the active SessionStart on this connection.
    #[prost(uint64, tag = "2")]
    pub session_id: u64,
    /// Monotonic within a sender session. Responses from older rounds are stale.
    #[prost(uint64, tag = "3")]
    pub round_id: u64,
    /// V3 byte-bounded summary pagination. Page zero starts a pass; later pages
    /// echo its cursor, observed revision, and pinned TTL time. Revision drift is
    /// allowed during the bounded pass and forces a fresh verification pass.
    #[prost(uint64, tag = "4")]
    pub page_seq: u64,
    #[prost(string, tag = "5")]
    pub after_key: ::prost::alloc::string::String,
    #[prost(uint64, tag = "6")]
    pub snapshot_revision: u64,
    #[prost(uint64, tag = "7")]
    pub snapshot_time_ms: u64,
    /// Explicit full-outage recovery authority; absent during ordinary startup.
    #[prost(bytes = "vec", tag = "8")]
    pub recovery_epoch: ::prost::alloc::vec::Vec<u8>,
    #[prost(bytes = "vec", tag = "9")]
    pub recovery_replica_digest: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReconcileResponse {
    #[prost(uint32, tag = "1")]
    pub fragment: u32,
    #[prost(message, repeated, tag = "2")]
    pub summaries: ::prost::alloc::vec::Vec<KeySummary>,
    #[prost(uint64, tag = "3")]
    pub session_id: u64,
    #[prost(uint64, tag = "4")]
    pub round_id: u64,
    /// V3 page correlation and continuation metadata.
    #[prost(uint64, tag = "5")]
    pub page_seq: u64,
    #[prost(string, tag = "6")]
    pub next_after_key: ::prost::alloc::string::String,
    #[prost(uint64, tag = "7")]
    pub snapshot_revision: u64,
    #[prost(uint64, tag = "8")]
    pub snapshot_time_ms: u64,
    #[prost(bool, tag = "9")]
    pub done: bool,
    /// The responder could not continue this pass; discard its partial result
    /// and begin again with a fresh nonzero round id.
    #[prost(bool, tag = "10")]
    pub restart: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReconcileFetch {
    #[prost(uint32, tag = "1")]
    pub fragment: u32,
    #[prost(string, repeated, tag = "2")]
    pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(uint64, tag = "3")]
    pub session_id: u64,
    #[prost(uint64, tag = "4")]
    pub round_id: u64,
    /// Identifies the requested page within the round.
    #[prost(uint64, tag = "5")]
    pub chunk_seq: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReconcileData {
    #[prost(uint32, tag = "1")]
    pub fragment: u32,
    #[prost(message, repeated, tag = "2")]
    pub entries: ::prost::alloc::vec::Vec<SyncEntry>,
    #[prost(uint64, tag = "3")]
    pub session_id: u64,
    #[prost(uint64, tag = "4")]
    pub round_id: u64,
    #[prost(uint64, tag = "5")]
    pub chunk_seq: u64,
    /// V3 page correlation within one bounded fetch chunk. Large value sets are
    /// streamed across exact-byte-bounded pages.
    #[prost(uint64, tag = "6")]
    pub page_seq: u64,
    #[prost(bool, tag = "7")]
    pub done: bool,
}
/// Phase 6: multi-key fan-out. One message per remote fragment/owner attempt.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchPut {
    #[prost(message, repeated, tag = "1")]
    pub puts: ::prost::alloc::vec::Vec<ForwardedPut>,
    /// Phase 7: priority applied to every put in the batch.
    #[prost(enumeration = "Priority", tag = "2")]
    pub priority: i32,
    /// Correlates one ordered result per `puts` entry.
    #[prost(uint64, tag = "3")]
    pub req_id: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MutationResult {
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    #[prost(enumeration = "MutationStatus", tag = "2")]
    pub status: i32,
    #[prost(string, tag = "3")]
    pub error: ::prost::alloc::string::String,
    #[prost(uint64, tag = "4")]
    pub winner_timestamp_ms: u64,
    #[prost(string, tag = "5")]
    pub winner_node_id: ::prost::alloc::string::String,
    #[prost(bool, tag = "6")]
    pub winner_is_tombstone: bool,
    #[prost(uint32, tag = "7")]
    pub request_index: u32,
    /// Encoded WriteConcernResult, present only when a policy was requested.
    #[prost(bytes = "vec", optional, tag = "8")]
    pub write_concern: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
    #[prost(uint64, tag = "9")]
    pub winner_logical_counter: u64,
}
#[non_exhaustive]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WriteConcernPolicy {
    #[prost(enumeration = "WriteConcernLevel", tag = "1")]
    pub level: i32,
    #[prost(uint32, tag = "2")]
    pub acknowledgements: u32,
    #[prost(uint64, tag = "3")]
    pub timeout_ms: u64,
    #[prost(bool, tag = "4")]
    pub require_other_region: bool,
}
#[non_exhaustive]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WriteConcernResult {
    #[prost(enumeration = "WriteConcernStatus", tag = "1")]
    pub status: i32,
    #[prost(string, tag = "2")]
    pub receiving_node: ::prost::alloc::string::String,
    #[prost(uint32, tag = "3")]
    pub replica_count: u32,
    #[prost(uint32, tag = "4")]
    pub requested_acknowledgements: u32,
    #[prost(uint32, tag = "5")]
    pub required_acknowledgements: u32,
    #[prost(string, repeated, tag = "6")]
    pub acknowledged_nodes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, tag = "7")]
    pub error: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "8")]
    pub receiving_region: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "9")]
    pub outside_region_acknowledged_nodes: ::prost::alloc::vec::Vec<
        ::prost::alloc::string::String,
    >,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MutationResponse {
    #[prost(uint64, tag = "1")]
    pub req_id: u64,
    #[prost(message, repeated, tag = "2")]
    pub results: ::prost::alloc::vec::Vec<MutationResult>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BatchGet {
    #[prost(uint64, tag = "1")]
    pub req_id: u64,
    #[prost(string, repeated, tag = "2")]
    pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Phase 7: priority applied to every get in the batch.
    #[prost(enumeration = "Priority", tag = "3")]
    pub priority: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetResponse {
    #[prost(uint64, tag = "1")]
    pub req_id: u64,
    /// With CAPABILITY_BYTE_BOUNDED_BATCHES, a non-empty request returns either
    /// an empty unavailable response or a non-empty ordered prefix. The caller
    /// resumes an omitted suffix under a fresh request id.
    #[prost(message, repeated, tag = "2")]
    pub results: ::prost::alloc::vec::Vec<batch_get_response::KeyValue>,
}
/// Nested message and enum types in `BatchGetResponse`.
pub mod batch_get_response {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct KeyValue {
        #[prost(string, tag = "1")]
        pub key: ::prost::alloc::string::String,
        #[prost(bool, tag = "2")]
        pub found: bool,
        #[prost(bytes = "vec", tag = "3")]
        pub value: ::prost::alloc::vec::Vec<u8>,
        #[prost(uint64, tag = "4")]
        pub timestamp_ms: u64,
        #[prost(string, tag = "5")]
        pub node_id: ::prost::alloc::string::String,
        #[prost(uint64, tag = "6")]
        pub expires_at_ms: u64,
        #[prost(bool, tag = "7")]
        pub is_tombstone: bool,
        /// Phase 7: true if the read was shed due to backpressure (distinct
        /// from not-found).
        #[prost(bool, tag = "8")]
        pub shed: bool,
        #[prost(uint64, tag = "9")]
        pub logical_counter: u64,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Envelope {
    #[prost(
        oneof = "envelope::Msg",
        tags = "1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24"
    )]
    pub msg: ::core::option::Option<envelope::Msg>,
}
/// Nested message and enum types in `Envelope`.
pub mod envelope {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Msg {
        #[prost(message, tag = "1")]
        Hello(super::Hello),
        /// Phase 5: ReplicateOp (2) retired; batches carry Repeated ReplicateOp.
        #[prost(message, tag = "3")]
        SyncRequest(super::SyncRequest),
        #[prost(message, tag = "4")]
        SyncResponse(super::SyncResponse),
        #[prost(message, tag = "5")]
        ForwardedPut(super::ForwardedPut),
        #[prost(message, tag = "6")]
        ForwardedGet(super::ForwardedGet),
        #[prost(message, tag = "7")]
        GetResponse(super::GetResponse),
        #[prost(message, tag = "8")]
        SessionStart(super::SessionStart),
        #[prost(message, tag = "9")]
        ReplicateBatch(super::ReplicateBatch),
        #[prost(message, tag = "10")]
        BatchAck(super::BatchAck),
        #[prost(message, tag = "11")]
        ReconcileRequest(super::ReconcileRequest),
        #[prost(message, tag = "12")]
        ReconcileResponse(super::ReconcileResponse),
        #[prost(message, tag = "13")]
        ReconcileFetch(super::ReconcileFetch),
        #[prost(message, tag = "14")]
        ReconcileData(super::ReconcileData),
        #[prost(message, tag = "15")]
        BatchPut(super::BatchPut),
        #[prost(message, tag = "16")]
        BatchGet(super::BatchGet),
        #[prost(message, tag = "17")]
        BatchGetResponse(super::BatchGetResponse),
        #[prost(message, tag = "18")]
        MutationResponse(super::MutationResponse),
        #[prost(message, tag = "19")]
        BatchNack(super::BatchNack),
        #[prost(message, tag = "20")]
        HelloAuth(super::HelloAuth),
        #[prost(message, tag = "21")]
        ScanRequest(super::ScanRequest),
        #[prost(message, tag = "22")]
        ScanResponse(super::ScanResponse),
        #[prost(message, tag = "23")]
        QueryPageRequest(super::QueryPageRequest),
        #[prost(message, tag = "24")]
        QueryPageResponse(super::QueryPageResponse),
    }
}
/// Distributed scan: coordinator -> fragment holder. Mirrors ForwardedGet:
/// one holder per fragment, failover across replica_order, hop-bounded
/// re-forwarding during placement migration. The spec is data, never code.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ScanRequest {
    #[prost(uint64, tag = "1")]
    pub req_id: u64,
    #[prost(uint32, tag = "2")]
    pub fragment: u32,
    /// Matcher descriptor: 0=all, 1=key prefix.
    #[prost(uint32, tag = "3")]
    pub matcher_kind: u32,
    /// Matcher argument: prefix bytes when matcher_kind=1.
    #[prost(bytes = "vec", tag = "4")]
    pub matcher_arg: ::prost::alloc::vec::Vec<u8>,
    /// Transform descriptor: 0=identity, 1=key_only, 2=prefix_bytes.
    #[prost(uint32, tag = "5")]
    pub transform_kind: u32,
    /// Transform argument: N when transform_kind=2.
    #[prost(uint32, tag = "6")]
    pub transform_arg: u32,
    /// Per-fragment match bound. 0 = server default. This bound is also the
    /// wire-size safety: the response is a single envelope, so limit *
    /// avg value size must stay comfortably under the 16 MiB frame cap.
    #[prost(uint32, tag = "7")]
    pub limit: u32,
    /// Skip-first-N pagination cursor (deterministic key order).
    #[prost(uint64, tag = "8")]
    pub offset: u64,
    /// Always PRIORITY_BACKGROUND for scans.
    #[prost(enumeration = "Priority", tag = "9")]
    pub priority: i32,
    /// Re-forward bound, as with ForwardedGet.
    #[prost(uint32, tag = "10")]
    pub hops: u32,
}
/// Holder -> coordinator. A single response per request; the per-fragment
/// limit keeps it under the frame cap.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScanResponse {
    #[prost(uint64, tag = "1")]
    pub req_id: u64,
    #[prost(message, repeated, tag = "2")]
    pub matches: ::prost::alloc::vec::Vec<ScanMatch>,
    /// Non-empty = this holder could not serve the scan (not serving, bad
    /// spec, shed). The coordinator fails over to the next replica holder.
    #[prost(string, tag = "3")]
    pub error: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ScanMatch {
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    /// Transformed value. Empty when the transform is key_only.
    #[prost(bytes = "vec", tag = "2")]
    pub value: ::prost::alloc::vec::Vec<u8>,
}
/// Bounded declarative query traversal. Continuations pin one holder incarnation,
/// revision, and TTL observation time. SQL is validated as data, never executed code.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueryPageRequest {
    #[prost(uint64, tag = "1")]
    pub req_id: u64,
    #[prost(uint32, tag = "2")]
    pub fragment: u32,
    #[prost(string, tag = "3")]
    pub sql: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub after_key: ::prost::alloc::string::String,
    #[prost(bool, tag = "5")]
    pub continuation: bool,
    #[prost(uint64, tag = "6")]
    pub revision: u64,
    #[prost(uint64, tag = "7")]
    pub snapshot_time_ms: u64,
    #[prost(uint64, tag = "8")]
    pub incarnation: u64,
    #[prost(uint32, tag = "9")]
    pub max_rows: u32,
    #[prost(uint32, tag = "10")]
    pub max_bytes: u32,
    #[prost(uint32, tag = "11")]
    pub max_visits: u32,
    #[prost(bool, tag = "12")]
    pub verify_only: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryPageResponse {
    #[prost(uint64, tag = "1")]
    pub req_id: u64,
    #[prost(uint32, tag = "2")]
    pub fragment: u32,
    #[prost(message, repeated, tag = "3")]
    pub rows: ::prost::alloc::vec::Vec<QueryPageRow>,
    #[prost(string, tag = "4")]
    pub next_after_key: ::prost::alloc::string::String,
    #[prost(bool, tag = "5")]
    pub done: bool,
    #[prost(uint64, tag = "6")]
    pub revision: u64,
    #[prost(uint64, tag = "7")]
    pub snapshot_time_ms: u64,
    #[prost(uint64, tag = "8")]
    pub incarnation: u64,
    #[prost(uint32, tag = "9")]
    pub visited: u32,
    #[prost(uint64, tag = "10")]
    pub work_bytes: u64,
    #[prost(enumeration = "QueryPageStatus", tag = "11")]
    pub status: i32,
    #[prost(string, tag = "12")]
    pub error: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryPageRow {
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "2")]
    pub cells: ::prost::alloc::vec::Vec<QueryCell>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueryCell {
    #[prost(oneof = "query_cell::Value", tags = "1, 2, 3, 4")]
    pub value: ::core::option::Option<query_cell::Value>,
}
/// Nested message and enum types in `QueryCell`.
pub mod query_cell {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Value {
        #[prost(bool, tag = "1")]
        Null(bool),
        #[prost(string, tag = "2")]
        Text(::prost::alloc::string::String),
        #[prost(bytes, tag = "3")]
        Bytes(::prost::alloc::vec::Vec<u8>),
        /// Canonical base-ten integer; preserves full i128 precision in every SDK.
        #[prost(string, tag = "4")]
        Integer(::prost::alloc::string::String),
    }
}
/// Phase 7: operation priority for traffic isolation. Wire values are
/// stable; PRIORITY_DEFAULT = 0 so an absent/unknown field degrades to
/// normal priority rather than misrouting.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Priority {
    Default = 0,
    High = 1,
    Background = 2,
}
impl Priority {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Default => "PRIORITY_DEFAULT",
            Self::High => "PRIORITY_HIGH",
            Self::Background => "PRIORITY_BACKGROUND",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PRIORITY_DEFAULT" => Some(Self::Default),
            "PRIORITY_HIGH" => Some(Self::High),
            "PRIORITY_BACKGROUND" => Some(Self::Background),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ReplicationAckLevel {
    Unknown = 0,
    Applied = 1,
    StoreCommitted = 2,
    StableCommitted = 3,
}
impl ReplicationAckLevel {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unknown => "REPLICATION_ACK_LEVEL_UNKNOWN",
            Self::Applied => "REPLICATION_ACK_LEVEL_APPLIED",
            Self::StoreCommitted => "REPLICATION_ACK_LEVEL_STORE_COMMITTED",
            Self::StableCommitted => "REPLICATION_ACK_LEVEL_STABLE_COMMITTED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "REPLICATION_ACK_LEVEL_UNKNOWN" => Some(Self::Unknown),
            "REPLICATION_ACK_LEVEL_APPLIED" => Some(Self::Applied),
            "REPLICATION_ACK_LEVEL_STORE_COMMITTED" => Some(Self::StoreCommitted),
            "REPLICATION_ACK_LEVEL_STABLE_COMMITTED" => Some(Self::StableCommitted),
            _ => None,
        }
    }
}
/// Exact result of one remotely forwarded mutation. Results in a
/// MutationResponse have the same order and cardinality as the request.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MutationStatus {
    Unknown = 0,
    Applied = 1,
    AlreadyPresent = 2,
    Superseded = 3,
    Expired = 4,
    Backpressure = 5,
    StorageError = 6,
    ActorError = 7,
    Unavailable = 8,
    /// The mutation may have applied; a fresh-version retry is unsafe.
    UnknownOutcome = 9,
}
impl MutationStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unknown => "MUTATION_STATUS_UNKNOWN",
            Self::Applied => "MUTATION_STATUS_APPLIED",
            Self::AlreadyPresent => "MUTATION_STATUS_ALREADY_PRESENT",
            Self::Superseded => "MUTATION_STATUS_SUPERSEDED",
            Self::Expired => "MUTATION_STATUS_EXPIRED",
            Self::Backpressure => "MUTATION_STATUS_BACKPRESSURE",
            Self::StorageError => "MUTATION_STATUS_STORAGE_ERROR",
            Self::ActorError => "MUTATION_STATUS_ACTOR_ERROR",
            Self::Unavailable => "MUTATION_STATUS_UNAVAILABLE",
            Self::UnknownOutcome => "MUTATION_STATUS_UNKNOWN_OUTCOME",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "MUTATION_STATUS_UNKNOWN" => Some(Self::Unknown),
            "MUTATION_STATUS_APPLIED" => Some(Self::Applied),
            "MUTATION_STATUS_ALREADY_PRESENT" => Some(Self::AlreadyPresent),
            "MUTATION_STATUS_SUPERSEDED" => Some(Self::Superseded),
            "MUTATION_STATUS_EXPIRED" => Some(Self::Expired),
            "MUTATION_STATUS_BACKPRESSURE" => Some(Self::Backpressure),
            "MUTATION_STATUS_STORAGE_ERROR" => Some(Self::StorageError),
            "MUTATION_STATUS_ACTOR_ERROR" => Some(Self::ActorError),
            "MUTATION_STATUS_UNAVAILABLE" => Some(Self::Unavailable),
            "MUTATION_STATUS_UNKNOWN_OUTCOME" => Some(Self::UnknownOutcome),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum WriteConcernLevel {
    WriteConcernLocal = 0,
    WriteConcernCount = 1,
    WriteConcernMajority = 2,
}
impl WriteConcernLevel {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::WriteConcernLocal => "WRITE_CONCERN_LOCAL",
            Self::WriteConcernCount => "WRITE_CONCERN_COUNT",
            Self::WriteConcernMajority => "WRITE_CONCERN_MAJORITY",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "WRITE_CONCERN_LOCAL" => Some(Self::WriteConcernLocal),
            "WRITE_CONCERN_COUNT" => Some(Self::WriteConcernCount),
            "WRITE_CONCERN_MAJORITY" => Some(Self::WriteConcernMajority),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum WriteConcernStatus {
    WriteConcernSatisfied = 0,
    WriteConcernTimedOut = 1,
    WriteConcernInvalid = 2,
    WriteConcernBackpressure = 3,
    WriteConcernUnsupported = 4,
}
impl WriteConcernStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::WriteConcernSatisfied => "WRITE_CONCERN_SATISFIED",
            Self::WriteConcernTimedOut => "WRITE_CONCERN_TIMED_OUT",
            Self::WriteConcernInvalid => "WRITE_CONCERN_INVALID",
            Self::WriteConcernBackpressure => "WRITE_CONCERN_BACKPRESSURE",
            Self::WriteConcernUnsupported => "WRITE_CONCERN_UNSUPPORTED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "WRITE_CONCERN_SATISFIED" => Some(Self::WriteConcernSatisfied),
            "WRITE_CONCERN_TIMED_OUT" => Some(Self::WriteConcernTimedOut),
            "WRITE_CONCERN_INVALID" => Some(Self::WriteConcernInvalid),
            "WRITE_CONCERN_BACKPRESSURE" => Some(Self::WriteConcernBackpressure),
            "WRITE_CONCERN_UNSUPPORTED" => Some(Self::WriteConcernUnsupported),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum QueryPageStatus {
    Unknown = 0,
    Ok = 1,
    Changed = 2,
    Backpressure = 3,
    Unavailable = 4,
    Invalid = 5,
    Budget = 6,
}
impl QueryPageStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unknown => "QUERY_PAGE_STATUS_UNKNOWN",
            Self::Ok => "QUERY_PAGE_STATUS_OK",
            Self::Changed => "QUERY_PAGE_STATUS_CHANGED",
            Self::Backpressure => "QUERY_PAGE_STATUS_BACKPRESSURE",
            Self::Unavailable => "QUERY_PAGE_STATUS_UNAVAILABLE",
            Self::Invalid => "QUERY_PAGE_STATUS_INVALID",
            Self::Budget => "QUERY_PAGE_STATUS_BUDGET",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "QUERY_PAGE_STATUS_UNKNOWN" => Some(Self::Unknown),
            "QUERY_PAGE_STATUS_OK" => Some(Self::Ok),
            "QUERY_PAGE_STATUS_CHANGED" => Some(Self::Changed),
            "QUERY_PAGE_STATUS_BACKPRESSURE" => Some(Self::Backpressure),
            "QUERY_PAGE_STATUS_UNAVAILABLE" => Some(Self::Unavailable),
            "QUERY_PAGE_STATUS_INVALID" => Some(Self::Invalid),
            "QUERY_PAGE_STATUS_BUDGET" => Some(Self::Budget),
            _ => None,
        }
    }
}