#community-help

Troubleshooting Typesense Index Deletion Issue

TLDR John reported issues deleting old indices after upgrading Typesense. Kishore Nallan suggested checking for special characters and race conditions. Issue was resolved by catching the 404 error.

Powered by Struct AI
7
4mo
Solved
Join the chat
May 08, 2023 (4 months ago)
John
Photo of md5-21545f1facb7836c149bc4c70752bd2b
John
09:40 AM
We use a workflow where we replace indices by creating a new one, repointing an alias, and then deleting the old index. After upgrading our Typesense server to 0.25.0.rc25, we've started to have issues deleting old indices. Against our production instance I can reproduce that
• When querying for all collections, collection "foobar123" is there.
• When trying to delete it, I get No collection with name "foobar123" found.
Any ideas on how to resolve this?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
09:43 AM
1. What version of Typesense were you using before the upgrade?
2. What happens when you restart the Typesense process?
09:46
Kishore Nallan
09:46 AM
The interesting thing here is that both get all collections API and the delete collections API use the same structure for accessing the list of collections. So I am not sure how one doesn't find it.
John
Photo of md5-21545f1facb7836c149bc4c70752bd2b
John
09:49 AM
Aha, I just now noticed that after getting the No collection with name "foobar123" found error, "foobar123" is actually no longer returned from the collections endpoint so it is deleted from something.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
09:49 AM
Does your collection name maybe have some special characters?
John
Photo of md5-21545f1facb7836c149bc4c70752bd2b
John
09:49 AM
So my problem is probably resolved by just catching the 404 and assuming that it was deleted anyway.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
09:50 AM
What could be happening is also a race condition between issuing a deletion request and then checking for the collection's presence. One of the nodes could lag just a few seconds and if you query that collection then it could momentarily return the collection as present.