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
//! Database-ready quorum WAL over 1, 3, or 5 GCS Rapid zonal buckets
//! (typically three).
//!
//! Start with [`SegmentedVolume::recover`] using the database's durable
//! checkpoint boundary. Consume the returned [`Recovery`] stream through its
//! fixed end, then call [`Recovery::start`]. Submit caller-numbered opaque records
//! through [`WalHandle::enqueue_append`]; admission returns an
//! [`AppendCompletion`] without waiting for durability. A completion success is
//! durable on a strict-majority quorum of the configured zones. Use
//! [`Error::may_have_committed`] on a completion failure: ambiguous outcomes
//! may replay after takeover, so delivery is at-least-once.
//! [`Error::ActiveSegmentFull`] is different: it is definitive admission
//! backpressure, consumes no sequence number, and leaves the writer healthy.
//! Truncate retained sealed history so a deferred rotation can proceed, then
//! retry the same record.
//!
//! One sequence number identifies one application-encoded transaction record;
//! the WAL never adds another application-level batching layer. Startup replay
//! uses record boundaries through [`WalSeqNo`] and is available only on
//! [`Recovery`]. Once the database has
//! durably checkpointed its own state, call [`WalHandle::truncate_before`] to
//! delete whole sealed segments below that checkpoint. Startup and periodic
//! maintenance retry already-authorized deletion tombstones before repairing
//! missing immutable sealed copies; degraded rotations also schedule a targeted
//! repair. Active segments are never repaired in place, and maintenance never
//! advances the database's checkpoint floor autonomously. See the `database_wal`
//! example for the complete lifecycle.
//! Every fallible public operation returns [`Error`].
//!
//! # Operational constraints
//!
//! A typical production volume uses three Rapid buckets in distinct zones of
//! one region plus a regional bucket for the default GCS manifest store. Bucket
//! arguments are full v2 resource names, and zonal list order is durable replica
//! identity. Current manifests bind that ordered set in `chorus.buckets`;
//! its length is the replica count, and missing, duplicate, or later mismatched
//! bindings are rejected. Physical zone placement is not discoverable through
//! this API and remains an operator check.
//!
//! Rapid zonal buckets have neither Object Versioning nor soft delete, so
//! replacement and truncation deletes are permanent. Archive immutable sealed
//! segments before truncation when the database needs point-in-time recovery.
//! The default GCS manifest directory retains roughly 115 current checksummed
//! segments before rotation defers; custom [`ManifestStore`] implementations
//! may report a larger budget. [`WalEngineConfig::max_active_segment_bytes`]
//! bounds that deferral with non-poisoning [`Error::ActiveSegmentFull`]
//! backpressure.
//!
//! The default GCS manifest is one repeatedly updated object. Treat
//! [`WalEngineConfig::max_segment_bytes`] as the single-pending refill floor:
//! for encoded throughput `T` bytes/s and worst-case provision-plus-fold
//! latency `L`, size it above `T * L` with operational headroom. Exceeding that
//! bound is fail-closed: append dispatch pauses before an unregistered segment
//! can receive records.
pub use ;
pub use ;
pub use Error;
pub use GrpcReplicaFactory;
pub use ;
pub use ;
pub use ClientConfig;
pub use ;
pub use TransportCode;
/// Transport seam exposed only to the deterministic-simulation harness, which
/// supplies an in-memory `ReplicaFactory` in place of the gRPC transport.
pub use ;
/// Helpers for repository probes that intentionally share transport details.
///
/// This module is excluded from the default API and is available only with the
/// `probe-support` Cargo feature.
/// Capacity introspection for the deterministic simulation harness.
///
/// Excluded from the default API and available only with the `dst-support`
/// Cargo feature. The harness uses this to mirror the engine's rotation gate:
/// a swap may only begin when the directory can hold both the old tail and the
/// in-flight pending that a swap-window crash would force recovery to seal.