|
|
@@ -82,6 +82,10 @@ service DatabaseService {
|
|
|
// Health and stats
|
|
|
rpc HealthCheck(HealthCheckRequest) returns (HealthCheckResponse);
|
|
|
rpc GetStats(GetStatsRequest) returns (GetStatsResponse);
|
|
|
+
|
|
|
+ // Read-only runtime state control
|
|
|
+ rpc SetReadOnly(SetReadOnlyRequest) returns (SetReadOnlyResponse);
|
|
|
+ rpc GetReadOnlyStatus(GetReadOnlyStatusRequest) returns (GetReadOnlyStatusResponse);
|
|
|
}
|
|
|
|
|
|
// ===== Replication Service =====
|
|
|
@@ -786,3 +790,29 @@ message MigrateCollectionTimestampsResponse {
|
|
|
uint64 rows_migrated = 3; // how many documents had their timestamps updated
|
|
|
uint64 rows_skipped = 4; // already in target range (idempotent resume)
|
|
|
}
|
|
|
+
|
|
|
+// ===== Read-Only Control =====
|
|
|
+
|
|
|
+message SetReadOnlyRequest {
|
|
|
+ bool read_only = 1;
|
|
|
+}
|
|
|
+
|
|
|
+message SetReadOnlyResponse {
|
|
|
+ bool success = 1;
|
|
|
+ bool was_read_only = 2; // previous state
|
|
|
+ string error = 3;
|
|
|
+}
|
|
|
+
|
|
|
+message GetReadOnlyStatusRequest {}
|
|
|
+
|
|
|
+message GetReadOnlyStatusResponse {
|
|
|
+ bool read_only = 1;
|
|
|
+ string reason = 2;
|
|
|
+ // Recovery outcome details (populated when auto-readonly triggered)
|
|
|
+ string recovery_outcome = 3; // "trivial_success" | "fresh_install" | "snapshot_fell_back" | "wal_only_replay" | "forced_empty" | "failed"
|
|
|
+ string expected_snapshot = 4;
|
|
|
+ string snapshot_used = 5;
|
|
|
+ string failure_reason = 6;
|
|
|
+ uint64 wal_entries_replayed = 7;
|
|
|
+ uint32 snapshots_attempted = 8;
|
|
|
+}
|