diff --git a/proto/collections.proto b/proto/collections.proto
index fd067ab..c7f2e10 100644
--- a/proto/collections.proto
+++ b/proto/collections.proto
@@ -494,12 +494,12 @@ message StrictModeConfig {
optional uint64 max_points_count = 18;
// Max number of payload indexes in a collection
optional uint64 max_payload_index_count = 19;
+ // Deprecated: memory is node-wide, use the global quota config instead. Removal planned for 1.21.
// Reject memory-consuming update operations when process resident memory exceeds this percentage of total RAM (cgroup-aware, 1-100).
// Delete-style operations are still allowed so memory can be freed.
- optional uint32 max_resident_memory_percent = 21;
- // Reject disk-consuming update operations when the filesystem hosting Qdrant storage exceeds this percentage of total capacity (1-100).
- // Free space is sampled with a small TTL cache so the gate may take a few seconds to react. Delete-style operations are still allowed so disk can be freed.
- optional uint32 max_disk_usage_percent = 22;
+ optional uint32 max_resident_memory_percent = 21 [deprecated = true];
+ // 22 was `max_disk_usage_percent`, superseded by the global quota config
+ reserved 22;
}
message StrictModeSparseConfig {
diff --git a/proto/points_service.proto b/proto/points_service.proto
index 162cb2f..cffc7d5 100644
--- a/proto/points_service.proto
+++ b/proto/points_service.proto
@@ -37,24 +37,48 @@ service Points {
rpc DeleteVectorName(DeleteVectorNameRequest) returns (PointsOperationResponse) {}
// Retrieve closest points based on vector similarity and given filtering
// conditions
- rpc Search(SearchPoints) returns (SearchResponse) {}
+ //
+ // Deprecated: use `Query` instead.
+ rpc Search(SearchPoints) returns (SearchResponse) {
+ option deprecated = true;
+ }
// Retrieve closest points based on vector similarity and given filtering
// conditions
- rpc SearchBatch(SearchBatchPoints) returns (SearchBatchResponse) {}
+ //
+ // Deprecated: use `QueryBatch` instead.
+ rpc SearchBatch(SearchBatchPoints) returns (SearchBatchResponse) {
+ option deprecated = true;
+ }
// Retrieve closest points based on vector similarity and given filtering
// conditions, grouped by a given field
- rpc SearchGroups(SearchPointGroups) returns (SearchGroupsResponse) {}
+ //
+ // Deprecated: use `QueryGroups` instead.
+ rpc SearchGroups(SearchPointGroups) returns (SearchGroupsResponse) {
+ option deprecated = true;
+ }
// Iterate over all or filtered points
rpc Scroll(ScrollPoints) returns (ScrollResponse) {}
// Look for the points which are closer to stored positive examples and at
// the same time further to negative examples.
- rpc Recommend(RecommendPoints) returns (RecommendResponse) {}
+ //
+ // Deprecated: use `Query` with a `recommend` query instead.
+ rpc Recommend(RecommendPoints) returns (RecommendResponse) {
+ option deprecated = true;
+ }
// Look for the points which are closer to stored positive examples and at
// the same time further to negative examples.
- rpc RecommendBatch(RecommendBatchPoints) returns (RecommendBatchResponse) {}
+ //
+ // Deprecated: use `QueryBatch` with `recommend` queries instead.
+ rpc RecommendBatch(RecommendBatchPoints) returns (RecommendBatchResponse) {
+ option deprecated = true;
+ }
// Look for the points which are closer to stored positive examples and at
// the same time further to negative examples, grouped by a given field
- rpc RecommendGroups(RecommendPointGroups) returns (RecommendGroupsResponse) {}
+ //
+ // Deprecated: use `QueryGroups` with a `recommend` query instead.
+ rpc RecommendGroups(RecommendPointGroups) returns (RecommendGroupsResponse) {
+ option deprecated = true;
+ }
// Use context and a target to find the most similar points to the target,
// constrained by the context.
//
@@ -74,9 +98,17 @@ service Points {
// distance to the target. The context part of the score for each pair is
// calculated +1 if the point is closer to a positive than to a negative part
// of a pair, and -1 otherwise.
- rpc Discover(DiscoverPoints) returns (DiscoverResponse) {}
+ //
+ // Deprecated: use `Query` with a `discover` or `context` query instead.
+ rpc Discover(DiscoverPoints) returns (DiscoverResponse) {
+ option deprecated = true;
+ }
// Batch request points based on { positive, negative } pairs of examples, and/or a target
- rpc DiscoverBatch(DiscoverBatchPoints) returns (DiscoverBatchResponse) {}
+ //
+ // Deprecated: use `QueryBatch` with `discover` or `context` queries instead.
+ rpc DiscoverBatch(DiscoverBatchPoints) returns (DiscoverBatchResponse) {
+ option deprecated = true;
+ }
// Count points in collection with given filtering conditions
rpc Count(CountPoints) returns (CountResponse) {}
diff --git a/proto/quota_internal.proto b/proto/quota_internal.proto
new file mode 100644
index 0000000..08b6ca2
--- /dev/null
+++ b/proto/quota_internal.proto
@@ -0,0 +1,25 @@
+syntax = "proto3";
+
+package qdrant;
+option csharp_namespace = "Qdrant.Client.Grpc";
+
+message GetQuotaUsageRequest {}
+
+message GetQuotaUsageResponse {
+ QuotaUsage result = 1;
+ // Time spent to process
+ double time = 2;
+}
+
+// Utilization of the quota-managed resources on the peer that answered.
+message QuotaUsage {
+ // Resident memory as a percentage of the memory available to the process,
+ // absent when the platform does not expose the stat.
+ optional uint32 resident_memory_percent = 1;
+ // Used space of the storage filesystem as a percentage of its capacity,
+ // absent when it cannot be read.
+ optional uint32 disk_usage_percent = 2;
+ // Whether this peer is at or over one of the limits it enforces, and so is
+ // currently refusing updates. Always false while the quota is disabled.
+ bool exceeded = 3;
+}
diff --git a/src/builders/strict_mode_config_builder.rs b/src/builders/strict_mode_config_builder.rs
index 03a3f1e..7c32779 100644
--- a/src/builders/strict_mode_config_builder.rs
+++ b/src/builders/strict_mode_config_builder.rs
@@ -23,8 +23,11 @@ pub struct StrictModeConfigBuilder {
pub(crate) sparse_config: Option