Skip to content

Conversation

@nathanwilk7
Copy link

@nathanwilk7 nathanwilk7 commented Jan 29, 2025

The point of this PR is to verify the behavior of Weaviate when rolling back after creating multivectors.

This PR adds a test which does the following for a couple past versions of Weaviate (1.26 - 1.29):

  1. Using the "current" version of Weaviate, creates one normal vector collection, one multivector collection, and one collection with both normal and multivectors.
  2. Ingest data into both collections.
  3. Restart Weaviate with the old version.
  4. Verify the support of the old version for multivectors by querying the relevant collections (note that some old versions fully support multivectors, some drop them, and some do not support them at all).
  5. Restart Weaviate with the "current" version and verify the queries work.

Copy link

@orca-security-eu orca-security-eu bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 1   info 2 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca
🛡️ The following IaC misconfigurations have been detected
NAME FILE
low Apt Get Install Pin Version Not Defined ...atibility/Dockerfile View in code
info APT-GET Not Avoiding Additional Packages ...atibility/Dockerfile View in code
info Apt Get Install Lists Were Not Deleted ...atibility/Dockerfile View in code

@weaviate-git-bot
Copy link

To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Slack channel?

}


declare -a no_multivector_versions=(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On version 1.24.26, I get the error:

# Traceback (most recent call last):
#   File "/workdir/verify_multivectors.py", line 43, in <module>
#     assert len(normal_objects.objects) == 1, f"Expected 1 object in {NORMAL_VECTOR_COLLECTION_NAME}, got {len(normal_objects.objects)}"
#            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# AssertionError: Expected 1 object in Normalvector, got 0

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On version 1.25.29, I get the error:

# Traceback (most recent call last):
#   File "/workdir/verify_multivectors.py", line 71, in <module>
#     normal_results = normal_collection.query.near_vector(
#                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#   File "/usr/local/lib/python3.11/site-packages/weaviate/syncify.py", line 23, in sync_method
#     return _EventLoopSingleton.get_instance().run_until_complete(
#            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#   File "/usr/local/lib/python3.11/site-packages/weaviate/event_loop.py", line 42, in run_until_complete
#     return fut.result()
#            ^^^^^^^^^^^^
#   File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 456, in result
#     return self.__get_result()
#            ^^^^^^^^^^^^^^^^^^^
#   File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
#     raise self._exception
#   File "/usr/local/lib/python3.11/site-packages/weaviate/collections/queries/near_vector/query.py", line 92, in near_vector
#     res = await self._query.near_vector(
#                 ^^^^^^^^^^^^^^^^^^^^^^^^
#   File "/usr/local/lib/python3.11/site-packages/weaviate/collections/grpc/query.py", line 248, in near_vector
#     near_vector=self._parse_near_vector(
#                 ^^^^^^^^^^^^^^^^^^^^^^^^
#   File "/usr/local/lib/python3.11/site-packages/weaviate/collections/grpc/shared.py", line 376, in _parse_near_vector
#     vector_per_target_tmp, near_vector_grpc = self._vector_per_target(
#                                               ^^^^^^^^^^^^^^^^^^^^^^^^
#   File "/usr/local/lib/python3.11/site-packages/weaviate/collections/grpc/shared.py", line 129, in _vector_per_target
#     raise WeaviateInvalidInputError(
# weaviate.exceptions.WeaviateInvalidInputError: Invalid input provided: The number of target vectors must be equal to the number of vectors..

@nathanwilk7 nathanwilk7 changed the title WIP Multivector version compatibility test Multivector backwards compatibility test Mar 12, 2025
@nathanwilk7 nathanwilk7 marked this pull request as ready for review March 12, 2025 17:09
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