Hi, I'm running typesense 29 on a 3-node cluster a...
# community-help
v
Hi, I'm running typesense 29 on a 3-node cluster and I'm seeing thousands of log lines that look like this (always the same "sequence_id", different document IDs): `Error while getting related ids: Could not find
auto_gallery_pk_sequence_id
value for doc
5318541
.` The relevant parts of the schema are: schema "foo":
{
name: "auto_gallery_pk",
type: "string",
optional: true,
reference: "gallery.id",
async_reference: true
}
schema "gallery":
{name: "pk", type: "int64"}
Am I missing anything obvious? or any idea what to do about this? Unfortunately I couldn't find a way of replicating locally
f
Does the doc with that id include a value for the auto_gallery_pk_sequence_id?
v
I'm not sure, how would I check?
f
You can execute a search request and filter by that id. E.g.
{q: "*", filter_by: "id:=5318541"}
v
it doesn't find anything, isn't the value in the logs (5318541) an internal ID?
f
The id is the one either given by you, or automatically generated
v
so here: `Could not find
auto_gallery_pk_sequence_id
value for doc
5318541
.` I assumed
5318541
was an internal ID because of `"Could not find
" + reference_helper_field_name + "
value for doc
" + std::to_string(seq_id)
but I understand it's a document ID (probably auto generated) and it's weird that this document isn't in my collections
same with
/collections/{collection_name}/documents/5318541
,
{"message": "Could not find a document with id: 5318541"}
However, it's important to keep in mind that a collection's documents store the internal IDs of the referenced collection's documents.
https://typesense.org/docs/29.0/api/joins.html#using-aliases-with-joins could be why I can't find these IDs in my collection
ok I can confirm these are internal IDs, with the schema I described if I insert a doc with ID 99 referencing another doc with ID 55 (so two collections, one doc per collection with ID 99 and 55), the logs show `Could not find
auto_gallery_pk_sequence_id
value for doc `1`` when I search with join
f
Could you provide a sample dataset and a simple script like this one that reproduces the behavior? It's hard for us to debug this without any dataset https://gist.github.com/jasonbosco/7c3432713216c378472f13e72246f46b/
v
sure, will do!
https://gist.github.com/Awea/ba4870a950f714086b03d55401069934 do you want us to open an issue on github?
f
CC: @Harpreet Sangar Could you check this out?
👀 1
🙏 1
k
@Victor, In the gist you provided, referenced field
building_id
is set optional and not all records are having value of the
building_id
. So when that field is included and if a doc is not having that value, it'll log that error. Please verify whether it is the case in your setup too.
v
@Krunal Gandhi Thanks for your answer! Yes, this is the case in my setup. From my understanding of the documentation, this is supported. Is that correct? Or is the gist I provided doing something that shouldn't be done with typesense?
k
Yes it is supported and your searches will go through. But if you include fields which are optional then this kind of errors are expected and those docs won't be populated with included fields which are not having those value.
v
OK thanks, I thought so but I didn't expect a supported thing to log errors, this log level being usually reserved for things that don't work or things that prevent some features from working.
h
@Victor You are right, maybe we should check if the reference field has been marked
async_reference
then we should switch to
LOG(INFO)
instead since these messages are expected in async reference scenario.
v
I think that would be great! Appreciate all the answers and the help!