Serverless Pod Deletion Latency

I have the following code that essentially iterates over a list of key value pairing metadata and deletes any vectors associated with these pairings. However, I notice that my deletes are not going through.

Is there a big latency behind deleting these vectors or am I doing this incorrectly?

for k,v in list_to_delete.items():

        print("Deleting", k)
        while True:
            matches = [x.id for x in index.query(
                vector=[0] * 1536,
                filter={
                    "origin": {"$eq": v},
                    "document_name": {"$eq": k}
                },
                top_k=10000,
                include_metadata=False
            ).matches]

            if len(matches) == 0:
                break
    
            print("Deleting", len(matches), "records")
            for i in range(0, len(matches), 1000):
                index.delete(ids=[matches[i:i+1000]])
                
            time.sleep(0.01)

I also noticed that my query on metadata keeps returning the same amount of documents each time. This is further evidence my stuff is not being deleted.

Deleting 290 records
Deleting 290 records
Deleting 290 records
Deleting 290 records
Deleting 290 records
Deleting 290 records
Deleting 290 records
Deleting 290 records

Hi @jonsnguyening, Pinecone is eventually consistent, so there can be a slight delay before new or changed records are visible to queries and other read requests.

After adding, updating, or deleting records, use the describe_index_stats operation to check if the current record count matches the number of records you expect.