Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nodes API for a specific collection not working in a multi-node setup #4582

Open
1 task done
jfrancoa opened this issue Apr 2, 2024 · 0 comments
Open
1 task done
Labels

Comments

@jfrancoa
Copy link
Contributor

jfrancoa commented Apr 2, 2024

How to reproduce this bug?

  1. Create a multi-node cluster, with 3 nodes for example (you can use weaviate-local-k8s for it):
REPLICAS=3 WEAVIATE_VERSION="1.24.6" ./local-k8s.sh setup
  1. Create two multi-tenant collections and create one tenant per collection by running this code twice:
# Generate a random string
    random_string = ''.join(random.choices(string.ascii_lowercase + string.digits, k=8))

    # Create collection
    collection = client.collections.create(
        name=f"Multitenant_{random_string}",
        vector_index_config=vector_index_config,
        multi_tenancy_config=wvc.Configure.multi_tenancy(enabled=True),
        properties=[
            wvc.Property(name="title", data_type=wvc.DataType.TEXT, vectorize_property_name=True, tokenization=wvc.Tokenization.WORD),
            wvc.Property(name="content", data_type=wvc.DataType.NUMBER, skip_vectorization=True),
        ]
    )
    
    collection.tenants.create([Tenant(name=f"tenant1")])
  1. Try to obtain nodes information for one of the collections by invoking:
curl "http://127.0.0.1:8080/v1/nodes/Multitenant_geszrv1i?output=verbose" | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   862  100   862    0     0  73424      0 --:--:-- --:--:-- --:--:-- 78363
{
  "nodes": [
    {
      "batchStats": {
        "queueLength": 0,
        "ratePerSecond": 0
      },
      "gitHash": "1ca441c",
      "name": "weaviate-0",
      "shards": [
        {
          "class": "Multitenant_geszrv1i",
          "compressed": false,
          "loaded": true,
          "name": "tenant0",
          "objectCount": 0,
          "vectorIndexingStatus": "READY",
          "vectorQueueLength": 0
        }
      ],
      "stats": {
        "objectCount": 0,
        "shardCount": 1
      },
      "status": "HEALTHY",
      "version": "1.24.6"
    },
    {
      "batchStats": {
        "queueLength": 0,
        "ratePerSecond": 0
      },
      "gitHash": "1ca441c",
      "name": "weaviate-1",
      "shards": [
        {
          "class": "Multitenant_gr8xn132",
          "compressed": false,
          "loaded": true,
          "name": "tenant0",
          "objectCount": 0,
          "vectorIndexingStatus": "READY",
          "vectorQueueLength": 0
        }
      ],
      "stats": {
        "objectCount": 0,
        "shardCount": 1
      },
      "status": "HEALTHY",
      "version": "1.24.6"
    },
    {
      "batchStats": {
        "queueLength": 0,
        "ratePerSecond": 0
      },
      "gitHash": "1ca441c",
      "name": "weaviate-2",
      "shards": null,
      "stats": {
        "objectCount": 0,
        "shardCount": 0
      },
      "status": "HEALTHY",
      "version": "1.24.6"
    }
  ]
}

As it can be observed, it displays the information for both collections, not only for the one passed Multitenant_geszrv1i.

However, this works fine if the node is a single-node cluster:

curl "http://127.0.0.1:8080/v1/nodes?output=verbose" | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   497  100   497    0     0  51481      0 --:--:-- --:--:-- --:--:-- 55222
{
  "nodes": [
    {
      "batchStats": {
        "queueLength": 0,
        "ratePerSecond": 0
      },
      "gitHash": "1ca441c",
      "name": "weaviate-0",
      "shards": [
        {
          "class": "Multitenant_bgfildc9",
          "compressed": false,
          "loaded": true,
          "name": "tenant0",
          "objectCount": 0,
          "vectorIndexingStatus": "READY",
          "vectorQueueLength": 0
        },
        {
          "class": "Multitenant_92bolzw5",
          "compressed": false,
          "loaded": true,
          "name": "tenant0",
          "objectCount": 0,
          "vectorIndexingStatus": "READY",
          "vectorQueueLength": 0
        }
      ],
      "stats": {
        "objectCount": 0,
        "shardCount": 2
      },
      "status": "HEALTHY",
      "version": "1.24.6"
    }
  ]
}


curl "http://127.0.0.1:8080/v1/nodes/Multitenant_bgfildc9?output=verbose" | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   345  100   345    0     0  37321      0 --:--:-- --:--:-- --:--:-- 38333
{
  "nodes": [
    {
      "batchStats": {
        "queueLength": 0,
        "ratePerSecond": 0
      },
      "gitHash": "1ca441c",
      "name": "weaviate-0",
      "shards": [
        {
          "class": "Multitenant_bgfildc9",
          "compressed": false,
          "loaded": true,
          "name": "tenant0",
          "objectCount": 0,
          "vectorIndexingStatus": "READY",
          "vectorQueueLength": 0
        }
      ],
      "stats": {
        "objectCount": 0,
        "shardCount": 1
      },
      "status": "HEALTHY",
      "version": "1.24.6"
    }
  ]
}

What is the expected behavior?

Only information for the passed collection is displayed in the nodes API response.

What is the actual behavior?

Nodes information is displayed for all collections, even though we specified the collection we wanted to retrieve information from.

Supporting information

No response

Server Version

1.24.6

Code of Conduct

@jfrancoa jfrancoa added the bug label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant