Thread: `async_reference: true` not resolving refe...
# community-help
m
Thread:
async_reference: true
not resolving references retroactively on bulk import (v30.1)
👀 1
Hey folks! We ran into what looks like a bug with
async_reference: true
and wanted to confirm before opening a GitHub issue. Setup: - Collection
authors
— the parent, with field
id
- Collection
books
— child, with a field
author_id: { type: "string", reference: "authors.id", async_reference: true }
What happened: 1. We bulk-imported
books
(~300K docs) via
/documents/import
before
authors
was fully populated (authors had ~65% of the expected docs at the time) 2.
async_reference: true
correctly accepted all inserts without errors — as expected 3. We then imported the remaining ~35% of docs into
authors
, bringing it to 100% 4. Expected (per docs): "The resolution of references will happen automatically when the referenced documents get indexed later" 5. Actual: joins from
authors
→
books
did NOT resolve for the books whose author was missing at import time. Queries like
$books(title:=*)
on
authors
returned 0 results for those documents. A full re-import of
books
was required to fix the joins. Question: Is
async_reference
only guaranteed to resolve references for single-document upserts, or should it also work retroactively after a bulk import via
/documents/import
? Is this a known limitation in v30.1, or a bug? Workaround found: Re-importing
books
after
authors
is fully populated fixes everything — but it's unexpected given the docs. Thanks!
j
Hi Matheus. I've tried to simulate this locally and haven't been able to, it sounds like a bug yes. Could you open a issue on the GitHub with a reproduction gist? We'll take a look as soon as possible 🙂
👍 1
h
@Matheus Bombonato https://github.com/typesense/typesense/pull/2815 PR addresses the concurrency issues related to references.
❤️ 1
m
Thanks for the feedback! I'll await for a RC release with that fix to test it again ;)