when I make a big schema change, like adding a new...
# community-help
m
when I make a big schema change, like adding a new not-nullable field, i want to delete and remake a collection. the problem i always run into is that i have to wait for a while after deleting before creating it again or i get a 409 error. i even try checking if i get a 404 when retrieving the collection before trying to recreate, but i can still get a 409. even if i wait 30 seconds and check if the collection exists first i still get a 409 it would be really nice if deleting a collection returned once things are syned, or at least i could do a consistent read when asking if a collection exists
k
the problem i always run into is that i have to wait for a while after deleting before creating it again
Deletion of a large collection could take some time. If you are doing this from a client with a short connection timeout, the "call" could return early but the underlying operation could still be in progress.
Try setting a large connection timeout -- the API does return only when things are synced.
m
even if the collection is mostly empty it seems to happen
i don't think the API returns before the collection is fully deleted, i still get a 409 if i wait for collection delete to return
k
Is this on a single node or a clustered setup?
m
single node
same issues if i create a collection and then try to put stuff in it, the create collection API call returns but i get an error if i try to use it even with a 10s delay
there's a 10s sleep after creating but i still hit that
j
Could you try running this standalone example against your cluster and see if you’re able to replicate the issue: https://github.com/typesense/typesense-js/blob/master/doc/examples/server/documents.js
m
seems like it ran ok
j
Hmmm, could you try adding your application-specific logic with that working script as a base, to see where things are different?