Skip to content

Commit fb9e2d0

Browse files
committed
update clients (#880)
* update clients * new: update conversions * fix: update inspection cache * update grpc * bump fastembed to 0.5.1 * update poetry lock * update poetry lock
1 parent 332253a commit fb9e2d0

File tree

11 files changed

+651
-394
lines changed

11 files changed

+651
-394
lines changed

poetry.lock

Lines changed: 389 additions & 246 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ grpcio-tools = ">=1.41.0"
2727
urllib3 = ">=1.26.14,<3"
2828
portalocker = "^2.7.0"
2929
fastembed = [
30-
{ version = "0.5.0", optional = true },
30+
{ version = "0.5.1", optional = true },
3131
]
3232
fastembed-gpu = [
33-
{ version = "0.5.0", optional = true },
33+
{ version = "0.5.1", optional = true },
3434
]
3535

3636
[tool.poetry.group.dev.dependencies]

qdrant_client/conversions/conversion.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,6 +2056,12 @@ def convert_strict_mode_config(cls, model: grpc.StrictModeConfig) -> rest.Strict
20562056
max_collection_payload_size_bytes=model.max_collection_payload_size_bytes
20572057
if model.HasField("max_collection_payload_size_bytes")
20582058
else None,
2059+
filter_max_conditions=model.filter_max_conditions
2060+
if model.HasField("filter_max_conditions")
2061+
else None,
2062+
condition_max_size=model.condition_max_size
2063+
if model.HasField("condition_max_size")
2064+
else None,
20592065
)
20602066

20612067

@@ -3997,4 +4003,6 @@ def convert_strict_mode_config(cls, model: rest.StrictModeConfig) -> grpc.Strict
39974003
read_rate_limit=model.read_rate_limit,
39984004
write_rate_limit=model.write_rate_limit,
39994005
max_collection_payload_size_bytes=model.max_collection_payload_size_bytes,
4006+
filter_max_conditions=model.filter_max_conditions,
4007+
condition_max_size=model.condition_max_size,
40004008
)

qdrant_client/embed/_inspection_cache.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@
215215
"InferenceObject": [],
216216
"StrictModeConfig": [],
217217
"HasVectorCondition": [],
218+
"AbortReshardingOperation": [],
219+
"StartResharding": [],
220+
"StartReshardingOperation": [],
218221
}
219222
DEFS = {
220223
"AbortShardTransfer": {
@@ -3048,6 +3051,46 @@
30483051
"title": "UpsertOperation",
30493052
"type": "object",
30503053
},
3054+
"ReshardingDirectionOneOf": {
3055+
"description": "Scale up, add a new shard",
3056+
"enum": ["up"],
3057+
"title": "ReshardingDirectionOneOf",
3058+
"type": "string",
3059+
},
3060+
"ReshardingDirectionOneOf1": {
3061+
"description": "Scale down, remove a shard",
3062+
"enum": ["down"],
3063+
"title": "ReshardingDirectionOneOf1",
3064+
"type": "string",
3065+
},
3066+
"StartResharding": {
3067+
"additionalProperties": False,
3068+
"properties": {
3069+
"direction": {
3070+
"anyOf": [
3071+
{"$ref": "#/$defs/ReshardingDirectionOneOf"},
3072+
{"$ref": "#/$defs/ReshardingDirectionOneOf1"},
3073+
],
3074+
"description": "",
3075+
"title": "Direction",
3076+
},
3077+
"peer_id": {
3078+
"anyOf": [{"type": "integer"}, {"type": "null"}],
3079+
"default": None,
3080+
"description": "",
3081+
"title": "Peer Id",
3082+
},
3083+
"shard_key": {
3084+
"anyOf": [{"type": "integer"}, {"type": "string"}, {"type": "null"}],
3085+
"default": None,
3086+
"description": "",
3087+
"title": "Shard Key",
3088+
},
3089+
},
3090+
"required": ["direction"],
3091+
"title": "StartResharding",
3092+
"type": "object",
3093+
},
30513094
}
30523095
RECURSIVE_REFS = ["Filter", "MinShould", "Nested", "NestedCondition", "Prefetch"]
30533096
INCLUDED_RECURSIVE_REFS = ["Prefetch"]

qdrant_client/grpc/collections_pb2.py

Lines changed: 128 additions & 122 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

qdrant_client/grpc/points_pb2.py

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

qdrant_client/http/api/service_api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,16 @@ def _build_for_root(
164164
def _build_for_telemetry(
165165
self,
166166
anonymize: bool = None,
167+
details_level: int = None,
167168
):
168169
"""
169170
Collect telemetry data including app info, system info, collections info, cluster info, configs and statistics
170171
"""
171172
query_params = {}
172173
if anonymize is not None:
173174
query_params["anonymize"] = str(anonymize).lower()
175+
if details_level is not None:
176+
query_params["details_level"] = str(details_level)
174177

175178
headers = {}
176179
return self.api_client.request(
@@ -248,12 +251,14 @@ async def root(
248251
async def telemetry(
249252
self,
250253
anonymize: bool = None,
254+
details_level: int = None,
251255
) -> m.InlineResponse2001:
252256
"""
253257
Collect telemetry data including app info, system info, collections info, cluster info, configs and statistics
254258
"""
255259
return await self._build_for_telemetry(
256260
anonymize=anonymize,
261+
details_level=details_level,
257262
)
258263

259264

@@ -323,10 +328,12 @@ def root(
323328
def telemetry(
324329
self,
325330
anonymize: bool = None,
331+
details_level: int = None,
326332
) -> m.InlineResponse2001:
327333
"""
328334
Collect telemetry data including app info, system info, collections info, cluster info, configs and statistics
329335
"""
330336
return self._build_for_telemetry(
331337
anonymize=anonymize,
338+
details_level=details_level,
332339
)

qdrant_client/http/models/models.py

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
VectorsConfigDiff = Dict[str, "VectorParamsDiff"]
1212

1313

14+
class AbortReshardingOperation(BaseModel, extra="forbid"):
15+
abort_resharding: Any = Field(..., description="")
16+
17+
1418
class AbortShardTransfer(BaseModel, extra="forbid"):
1519
shard_id: int = Field(..., description="")
1620
to_peer_id: int = Field(..., description="")
@@ -839,6 +843,8 @@ class HardwareUsage(BaseModel):
839843
"""
840844

841845
cpu: int = Field(..., description="Usage of the hardware resources, spent to process the request")
846+
io_read: int = Field(..., description="Usage of the hardware resources, spent to process the request")
847+
io_write: int = Field(..., description="Usage of the hardware resources, spent to process the request")
842848

843849

844850
class HasIdCondition(BaseModel, extra="forbid"):
@@ -2001,6 +2007,8 @@ def __str__(self) -> str:
20012007
LISTENER = "Listener"
20022008
PARTIALSNAPSHOT = "PartialSnapshot"
20032009
RECOVERY = "Recovery"
2010+
RESHARDING = "Resharding"
2011+
RESHARDINGSCALEDOWN = "ReshardingScaleDown"
20042012

20052013

20062014
class ReplicateShard(BaseModel, extra="forbid"):
@@ -2048,10 +2056,6 @@ class ReshardingInfo(BaseModel):
20482056
shard_id: int = Field(..., description="")
20492057
peer_id: int = Field(..., description="")
20502058
shard_key: Optional["ShardKey"] = Field(default=None, description="")
2051-
comment: Optional[str] = Field(
2052-
default=None,
2053-
description="A human-readable report of the operation progress. Available only on the source peer.",
2054-
)
20552059

20562060

20572061
class RestartTransfer(BaseModel, extra="forbid"):
@@ -2400,6 +2404,10 @@ def __str__(self) -> str:
24002404

24012405
class ShardTransferInfo(BaseModel):
24022406
shard_id: int = Field(..., description="")
2407+
to_shard_id: Optional[int] = Field(
2408+
default=None,
2409+
description="Target shard ID if different than source shard ID Used exclusively with `ReshardStreamRecords` transfer method.",
2410+
)
24032411
from_: int = Field(..., description="Source peer id", alias="from")
24042412
to: int = Field(..., description="Destination peer id")
24052413
sync: bool = Field(
@@ -2445,6 +2453,17 @@ def __str__(self) -> str:
24452453
WAL_DELTA = "wal_delta"
24462454

24472455

2456+
class ShardTransferMethodOneOf3(str, Enum):
2457+
"""
2458+
Shard transfer for resharding: stream all records in batches until all points are transferred.
2459+
"""
2460+
2461+
def __str__(self) -> str:
2462+
return str(self.value)
2463+
2464+
RESHARDING_STREAM_RECORDS = "resharding_stream_records"
2465+
2466+
24482467
class ShardingMethod(str, Enum):
24492468
AUTO = "auto"
24502469
CUSTOM = "custom"
@@ -2609,6 +2628,16 @@ def __str__(self) -> str:
26092628
MMAP = "mmap"
26102629

26112630

2631+
class StartResharding(BaseModel, extra="forbid"):
2632+
direction: "ReshardingDirection" = Field(..., description="")
2633+
peer_id: Optional[int] = Field(default=None, description="")
2634+
shard_key: Optional["ShardKey"] = Field(default=None, description="")
2635+
2636+
2637+
class StartReshardingOperation(BaseModel, extra="forbid"):
2638+
start_resharding: "StartResharding" = Field(..., description="")
2639+
2640+
26122641
class StateRole(str, Enum):
26132642
"""
26142643
Role of the peer in the consensus
@@ -2653,6 +2682,10 @@ class StrictModeConfig(BaseModel, extra="forbid"):
26532682
max_collection_payload_size_bytes: Optional[int] = Field(
26542683
default=None, description="Max size of a collections payload storage in bytes"
26552684
)
2685+
filter_max_conditions: Optional[int] = Field(default=None, description="Max conditions a filter can have.")
2686+
condition_max_size: Optional[int] = Field(
2687+
default=None, description="Max size of a condition, eg. items in `MatchAny`."
2688+
)
26562689

26572690

26582691
class TelemetryData(BaseModel):
@@ -2993,6 +3026,8 @@ def __str__(self) -> str:
29933026
CreateShardingKeyOperation,
29943027
DropShardingKeyOperation,
29953028
RestartTransferOperation,
3029+
StartReshardingOperation,
3030+
AbortReshardingOperation,
29963031
]
29973032
ClusterStatus = Union[
29983033
ClusterStatusOneOf,
@@ -3139,6 +3174,7 @@ def __str__(self) -> str:
31393174
ShardTransferMethodOneOf,
31403175
ShardTransferMethodOneOf1,
31413176
ShardTransferMethodOneOf2,
3177+
ShardTransferMethodOneOf3,
31423178
]
31433179
SparseIndexType = Union[
31443180
SparseIndexTypeOneOf,

qdrant_client/proto/collections.proto

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ message StrictModeConfig {
340340
optional uint32 read_rate_limit = 11; // Max number of read operations per minute per replica
341341
optional uint32 write_rate_limit = 12; // Max number of write operations per minute per replica
342342
optional uint64 max_collection_payload_size_bytes = 13;
343+
optional uint64 filter_max_conditions = 14;
344+
optional uint64 condition_max_size = 15;
343345
}
344346

345347
message CreateCollection {
@@ -589,6 +591,15 @@ message ReshardingInfo {
589591
uint32 shard_id = 1;
590592
uint64 peer_id = 2;
591593
optional ShardKey shard_key = 3;
594+
ReshardingDirection direction = 4;
595+
}
596+
597+
/*
598+
Resharding direction, scale up or down in number of shards
599+
*/
600+
enum ReshardingDirection {
601+
Up = 0; // Scale up, add a new shard
602+
Down = 1; // Scale down, remove a shard
592603
}
593604

594605
message CollectionClusterInfoResponse {
@@ -597,8 +608,7 @@ message CollectionClusterInfoResponse {
597608
repeated LocalShardInfo local_shards = 3; // Local shards
598609
repeated RemoteShardInfo remote_shards = 4; // Remote shards
599610
repeated ShardTransferInfo shard_transfers = 5; // Shard transfers
600-
// TODO(resharding): enable on release:
601-
// repeated ReshardingInfo resharding_operations = 6; // Resharding operations
611+
repeated ReshardingInfo resharding_operations = 6; // Resharding operations
602612
}
603613

604614
message MoveShard {

qdrant_client/proto/points.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,4 +1098,6 @@ message GeoPoint {
10981098

10991099
message HardwareUsage {
11001100
uint64 cpu = 1;
1101+
uint64 io_read = 2;
1102+
uint64 io_write = 3;
11011103
}

0 commit comments

Comments
 (0)