Orion Reed
10/21/2022, 1:54 PMext-firestore-typesense-search-indexToTypesenseOnFirestoreWrite
cloud function. I don’t understand why this would throw an error as it shouldn’t matter if a document exists to update it… any idea what I’m doing wrong here?Jason Bosco
10/21/2022, 5:37 PMOrion Reed
02/25/2023, 10:15 PM{
"textPayload": "Creating document {\"measure_text_length\":343,\"rank\":0.5,\"text\":\"Indexers certainly have a very strong want for data determinism, they are constantly monitoring and worried about their data veracity. it's very time consuming\\nConsumers are also feeling this too since we've seen cases with \\\"wrong\\\" data returned by queries\\nBut no we have not had an attack like that yet that we know of, but what's your point?\",\"title\":\"slack\",\"type\":\"message\",\"url\":\"<https://blockscienceteam.slack.com/archives/C036NAWP0CT/p1677261752395249?cid=C036NAWP0CT&thread_ts=1676059661.243089>\",\"id\":\"aHR0cHM6Ly9ibG9ja3NjaWVuY2V0ZWFtLnNsYWNrLmNvbS9hcmNoaXZlcy9DMDM2TkFXUDBDVC9wMTY3NzI2MTc1MjM5NTI0OT9jaWQ9QzAzNk5BV1AwQ1QmdGhyZWFkX3RzPTE2NzYwNTk2NjEuMjQzMDg5\"}",
"insertId": "63f8fbbb0005cfd5c189c11f",
"resource": {
"type": "cloud_function",
"labels": {
"project_id": "knowledge-management-333914",
"region": "us-central1",
"function_name": "ext-firestore-typesense-search-indexToTypesenseOnFirestoreWrite"
}
},
"timestamp": "2023-02-24T18:02:35.380885Z",
"severity": "DEBUG",
"labels": {
"instance_id": "00c61b117c5a189878a95fae39681518ed338d4fa826a35986e68469d2ec5b3070fede155da6333715bb7dfc26d0c4c0f650d7a4a775945d9115",
"execution_id": "qu4q7bkf0lq7"
},
"logName": "projects/knowledge-management-333914/logs/cloudfunctions.googleapis.com%2Fcloud-functions",
"trace": "projects/knowledge-management-333914/traces/a9c2419e85dd694ae3fe11d14d31bebf",
"receiveTimestamp": "2023-02-24T18:02:35.518729400Z"
}
And this is the error:
{
"textPayload": "Error: Request failed with HTTP code 409 | Server said: A document with id aHR0cHM6Ly9ibG9ja3NjaWVuY2V0ZWFtLnNsYWNrLmNvbS9hcmNoaXZlcy9DMDM2TkFXUDBDVC9wMTY3NzI2MTc1MjM5NTI0OT9jaWQ9QzAzNk5BV1AwQ1QmdGhyZWFkX3RzPTE2NzYwNTk2NjEuMjQzMDg5 already exists.\n at ApiCall.customErrorForResponse (/workspace/node_modules/typesense/lib/Typesense/ApiCall.js:229:21)\n at ApiCall.performRequest (/workspace/node_modules/typesense/lib/Typesense/ApiCall.js:118:48)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)",
"insertId": "63f8fbbb000bdb5feae60206",
"resource": {
"type": "cloud_function",
"labels": {
"project_id": "knowledge-management-333914",
"region": "us-central1",
"function_name": "ext-firestore-typesense-search-indexToTypesenseOnFirestoreWrite"
}
},
"timestamp": "2023-02-24T18:02:35.777055Z",
"severity": "ERROR",
"labels": {
"instance_id": "00c61b117c5a189878a95fae39681518ed338d4fa826a35986e68469d2ec5b3070fede155da6333715bb7dfc26d0c4c0f650d7a4a775945d9115",
"execution_id": "qu4q7bkf0lq7"
},
"logName": "projects/knowledge-management-333914/logs/cloudfunctions.googleapis.com%2Fcloud-functions",
"trace": "projects/knowledge-management-333914/traces/a9c2419e85dd694ae3fe11d14d31bebf",
"receiveTimestamp": "2023-02-24T18:02:35.852702927Z"
}
Jason Bosco
02/26/2023, 12:43 AMJason Bosco
02/26/2023, 12:43 AMOrion Reed
02/26/2023, 12:48 AMOrion Reed
02/26/2023, 12:49 AM{
"textPayload": "Upserting document {\"measure_text_length\":343,\"platform\":\"<http://blockscienceteam.slack.com|blockscienceteam.slack.com>\",\"rank\":0.5,\"text\":\"Indexers certainly have a very strong want for data determinism, they are constantly monitoring and worried about their data veracity. it's very time consuming\\nConsumers are also feeling this too since we've seen cases with \\\"wrong\\\" data returned by queries\\nBut no we have not had an attack like that yet that we know of, but what's your point?\",\"title\":\"slack\",\"type\":\"message\",\"url\":\"<https://blockscienceteam.slack.com/archives/C036NAWP0CT/p1677261752395249?cid=C036NAWP0CT&thread_ts=1676059661.243089>\",\"id\":\"aHR0cHM6Ly9ibG9ja3NjaWVuY2V0ZWFtLnNsYWNrLmNvbS9hcmNoaXZlcy9DMDM2TkFXUDBDVC9wMTY3NzI2MTc1MjM5NTI0OT9jaWQ9QzAzNk5BV1AwQ1QmdGhyZWFkX3RzPTE2NzYwNTk2NjEuMjQzMDg5\"}",
"insertId": "63f8fbba00080662c369637e",
"resource": {
"type": "cloud_function",
"labels": {
"region": "us-central1",
"function_name": "ext-firestore-typesense-search-indexToTypesenseOnFirestoreWrite",
"project_id": "knowledge-management-333914"
}
},
"timestamp": "2023-02-24T18:02:34.525922Z",
"severity": "DEBUG",
"labels": {
"execution_id": "qu4q00yzm4k2",
"instance_id": "00c61b117c5a189878a95fae39681518ed338d4fa826a35986e68469d2ec5b3070fede155da6333715bb7dfc26d0c4c0f650d7a4a775945d9115"
},
"logName": "projects/knowledge-management-333914/logs/cloudfunctions.googleapis.com%2Fcloud-functions",
"trace": "projects/knowledge-management-333914/traces/88dc0c0598a37d19e7d0901e25dfeb9c",
"receiveTimestamp": "2023-02-24T18:02:34.855731622Z"
}
Orion Reed
02/26/2023, 12:49 AMJason Bosco
02/26/2023, 12:50 AMJason Bosco
02/26/2023, 12:51 AMOrion Reed
02/26/2023, 12:51 AMJason Bosco
02/26/2023, 12:53 AMOne potential solution to this could be to query Firestore on each change trigger and push the latest version of the Firestore document to Typesense, instead of using the snapshot document from the eventBut from a cost perspective, do you think doing these reads for each Firestore write is reasonable? I guess it will essentially increase write costs by 33%?
Orion Reed
02/26/2023, 12:56 AMOrion Reed
02/26/2023, 12:57 AMJason Bosco
02/26/2023, 12:58 AMOrion Reed
02/26/2023, 1:03 AMOrion Reed
02/26/2023, 1:03 AMJason Bosco
02/26/2023, 1:03 AMOrion Reed
02/26/2023, 1:08 AMJason Bosco
02/26/2023, 1:10 AMOrion Reed
02/26/2023, 1:11 AMJason Bosco
02/26/2023, 1:11 AMOrion Reed
02/26/2023, 1:12 AMOrion Reed
02/26/2023, 1:13 AMJason Bosco
02/26/2023, 1:14 AMJason Bosco
02/26/2023, 1:15 AMOrion Reed
02/26/2023, 1:22 AMOrion Reed
02/26/2023, 1:23 AMOrion Reed
02/26/2023, 1:23 AMJason Bosco
02/26/2023, 1:27 AMOrion Reed
02/26/2023, 1:28 AMOrion Reed
02/26/2023, 1:29 AMOrion Reed
02/26/2023, 1:31 AMJason Bosco
02/26/2023, 1:31 AMOrion Reed
02/26/2023, 1:33 AMJason Bosco
02/26/2023, 1:34 AMJason Bosco
02/26/2023, 1:35 AMOrion Reed
02/26/2023, 1:35 AMJason Bosco
02/26/2023, 1:36 AMOrion Reed
02/26/2023, 1:37 AMJason Bosco
02/26/2023, 1:37 AMJason Bosco
02/26/2023, 1:38 AMOrion Reed
02/26/2023, 1:45 AMOrion Reed
02/26/2023, 1:45 AMOrion Reed
02/26/2023, 3:14 AMOrion Reed
02/26/2023, 3:15 AMJason Bosco
02/26/2023, 9:08 PM