|
|
@@ -82,6 +82,7 @@ service DatabaseService {
|
|
|
// Health and stats
|
|
|
rpc HealthCheck(HealthCheckRequest) returns (HealthCheckResponse);
|
|
|
rpc GetStats(GetStatsRequest) returns (GetStatsResponse);
|
|
|
+ rpc GetMemoryStats(GetMemoryStatsRequest) returns (GetMemoryStatsResponse);
|
|
|
|
|
|
// Read-only runtime state control
|
|
|
rpc SetReadOnly(SetReadOnlyRequest) returns (SetReadOnlyResponse);
|
|
|
@@ -434,6 +435,17 @@ message CollectionOptions {
|
|
|
repeated string sensitive_fields = 4;
|
|
|
uint32 max_versions = 5; // Max version history per document (0 = unlimited)
|
|
|
uint32 vector_dimension = 6; // Dimension of vectors stored in this collection (0 = not a vector collection)
|
|
|
+
|
|
|
+ // NEW in v1.7.0 — eviction priority for the collection.
|
|
|
+ // UNSPECIFIED is treated as NORMAL for backward compatibility.
|
|
|
+ MemoryPriority memory_priority = 7;
|
|
|
+}
|
|
|
+
|
|
|
+enum MemoryPriority {
|
|
|
+ MEMORY_PRIORITY_UNSPECIFIED = 0; // treated as NORMAL
|
|
|
+ MEMORY_PRIORITY_LOW = 1;
|
|
|
+ MEMORY_PRIORITY_NORMAL = 2;
|
|
|
+ MEMORY_PRIORITY_HIGH = 3;
|
|
|
}
|
|
|
|
|
|
message CreateCollectionResponse {
|
|
|
@@ -570,6 +582,10 @@ enum EventType {
|
|
|
EVENT_DELETE = 3;
|
|
|
EVENT_EXPIRE = 4;
|
|
|
EVENT_INVALIDATE = 5;
|
|
|
+
|
|
|
+ // NEW in v1.7.0 — memory-pressure observability events.
|
|
|
+ EVENT_MEMORY_PRESSURE_HIGH = 6; // Emitted when pressure reaches hard threshold
|
|
|
+ EVENT_MEMORY_EVICTION_BURST = 7; // Emitted when eviction runs a large burst
|
|
|
}
|
|
|
|
|
|
// ===== Replication =====
|
|
|
@@ -816,3 +832,29 @@ message GetReadOnlyStatusResponse {
|
|
|
uint64 wal_entries_replayed = 7;
|
|
|
uint32 snapshots_attempted = 8;
|
|
|
}
|
|
|
+
|
|
|
+// ===== Memory Stats =====
|
|
|
+// Added in v1.7.0. Wire-compatible — server-side implementation lands in T9.
|
|
|
+
|
|
|
+message GetMemoryStatsRequest {}
|
|
|
+
|
|
|
+message CollectionMemoryStats {
|
|
|
+ string collection = 1;
|
|
|
+ uint64 document_count = 2;
|
|
|
+ uint64 estimated_bytes = 3;
|
|
|
+ uint64 evicted_stub_count = 4;
|
|
|
+ MemoryPriority priority = 5;
|
|
|
+}
|
|
|
+
|
|
|
+message GetMemoryStatsResponse {
|
|
|
+ uint64 total_memory_bytes = 1;
|
|
|
+ uint64 max_memory_bytes = 2;
|
|
|
+ uint32 pressure_percent = 3; // current usage / max × 100
|
|
|
+ string pressure_level = 4; // "normal" | "soft" | "hard" | "emergency"
|
|
|
+ repeated CollectionMemoryStats collections = 5;
|
|
|
+
|
|
|
+ // Most recent eviction
|
|
|
+ uint64 last_eviction_timestamp = 6; // ms since epoch, 0 if none
|
|
|
+ uint64 last_eviction_docs = 7;
|
|
|
+ uint64 last_eviction_bytes_freed = 8;
|
|
|
+}
|