Skip to content

Check if server's and client's versions are compatible#206

Merged
tellet-q merged 10 commits intodevfrom
check-version-on-init
Jan 10, 2025
Merged

Check if server's and client's versions are compatible#206
tellet-q merged 10 commits intodevfrom
check-version-on-init

Conversation

@tellet-q
Copy link
Contributor

@tellet-q tellet-q commented Jan 2, 2025

Send request to fetch server version during init and compare with client version.

Introduce a boolean param check_compatibility (true by default). If it is true -> check versions during client init and generate a warning if versions are not compatible. Add public method skip_compatibility_check to skip the check:

Qdrant::from_url("http://localhost:6334").skip_compatibility_check().build();

Compatible versions are the ones that differ by one, i.e client version 1.6.x is compatible with server versions 1.5.x and 1.7.x but not 1.4.x or 1.8.x.

@tellet-q tellet-q requested a review from Anush008 January 2, 2025 09:04
@tellet-q tellet-q force-pushed the check-version-on-init branch from 80fb4fa to 29c5f97 Compare January 2, 2025 10:59
@tellet-q tellet-q changed the title WIP Check if server's and client's versions are compatible Jan 2, 2025
@tellet-q tellet-q force-pushed the check-version-on-init branch from e722b92 to d1c5141 Compare January 3, 2025 07:28
@tellet-q tellet-q requested review from generall and timvisee January 3, 2025 07:48
@generall generall self-assigned this Jan 3, 2025
@tellet-q tellet-q changed the title Check if server's and client's versions are compatible WIP: Check if server's and client's versions are compatible Jan 7, 2025
@tellet-q tellet-q assigned timvisee and unassigned generall Jan 7, 2025
@timvisee timvisee force-pushed the check-version-on-init branch from 22f050b to 3b53ff7 Compare January 7, 2025 13:41
@agourlay
Copy link
Member

agourlay commented Jan 9, 2025

I fixed the test by creating a new client for the check 🤷
It seems a client cannot be used by different Tokio runtimes.

@tellet-q tellet-q changed the title WIP: Check if server's and client's versions are compatible Check if server's and client's versions are compatible Jan 9, 2025
@timvisee timvisee removed their assignment Jan 10, 2025
@tellet-q tellet-q merged commit 9110a8b into dev Jan 10, 2025
2 checks passed
@tellet-q tellet-q deleted the check-version-on-init branch January 10, 2025 15:29
timvisee added a commit that referenced this pull request Jan 16, 2025
* Check versions compatibility during init

* Add tests

* Fetch server version using futures

* Do async health check in sync context

* Check compatibility in temporary thread

* create dedicated client to avoid 'Service was not ready'

* fmt

* Use semver crate

* Fix linter

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants