This message was deleted.
# community-help
s
This message was deleted.
k
If your collection data is static, the easiest way to do this is to create a new collection with the new schema, reindex data and then use the alias feature to swap traffic to the new collection. You can also use the alter collection schema operation but that current blocks both reads and writes.
e
i’m doing upsert, does that block reads?
sorry upsert on documents, not changing the index/schema
j
The collection isn't static, so I'd have to somehow bring the new collection back in sync with the old one if any items were added/removed.
Altering the collection schema might be the simplest, even if it does block reads and writes. What impacts the duration of the read/write block? How long it takes to re-index everything with the new schema?
k
The whole schema is validated and then only the field that's changed is re-indexed. Operation timing will depend on type of field modified.
In 0.26.x RC build, we have just improved this to ensure that only writes are blocked during an alter operation.
j
Oh smashing - thanks! Do document writes just hang until the re-index is complete or do they return some form of error?
k
They hang. Since most clients have a timeout they will likely return a timeout error.
j
Good to know, I'll look at disabling search whilst we're updating the schema - thanks!
👍 1