Unable to add PQ to an existing collection/class

Hi,

I’m trying to enable PQ on a largish collection/class of documents (~2mn) to optimise memory usage.

I’m following the guide here Product Quantization (compression) | Weaviate - Vector Database but when I run the code, almost verbatim, I get the following error:

2024/04/13 13:16:15 update class to use pq: status code: 422, error: {"error":[{"message":"module config is immutable"}]}

The cluster is on v1.24.8 and has been upgraded many times.

Thanks,

Hi @jbendotnet !

That’s strange as this is a mutable parameter.

I was able to change it here on a collection I have just created without any issues.

Do you see any outstanding logs in the server?

@DudaNogueira I’ll try again and keep an eye on logs and report back.

I’ve just tried and stepped through the process via delve, and the error is coming back from the REST API as a 422, nothing appears in the logs across all 5 nodes.

Could it be that I’m updating the class config, and attempting to update the class, rather than mutate a single property (just following the examples)?

Can you share the exact code you are using for that?

Hi @DudaNogueira, apols for the delay!

It’s pretty much verbatim the code from the docs I linked to:

class, err := client.Schema().ClassGetter().
		WithClassName(schemas.ClassNameArticle).Do(ctx)
	if err != nil {
		log.Fatalf("get class for vec idx cfg update: %v", err)
	}

	viConfig := class.VectorIndexConfig.(map[string]interface{})
	viConfig["pq"] = map[string]interface{}{
		"enabled":       true,
		"trainingLimit": 100_000,
		"segments":      96,
	}
	class.VectorIndexConfig = viConfig

	err = client.Schema().ClassUpdater().
		WithClass(class).Do(ctx)
	if err != nil {
		log.Fatalf("update class to use pq: %v", err)
	}