# Diagnosis

## Symptom

Upsert reports success, but a query seconds later does not return the new vectors.

## Likely cause

Fresh writes can take a moment to become queryable, or the query is hitting a different namespace (or index) than the upsert wrote to. A third option: the query filter excludes the new records' metadata.

## Confirm it

1. `fetch` the new ids directly. If fetch returns them, the write landed and the issue is query-side (timing, namespace, filter).
2. Compare the `namespace` argument on the upsert call and the query call character by character.
3. `describe_index_stats()` per namespace: confirm the counts moved where you expected.
4. Wait 10 to 30 seconds and re-query. If they appear, it was timing.

## Fix

1. Timing: add a short settle wait in ingest-then-query scripts, or poll fetch until the ids appear.
2. Namespace slip: use one namespace constant shared by ingest and query code.
3. Filter: ensure new records carry the metadata fields your query filters on.

## Verify the fix

After the fix, run the ingest-then-query sequence three times and assert the new ids appear in matches every time.