From 659de6a2f26b0b31478131f737ef71cb5f617c25 Mon Sep 17 00:00:00 2001 From: Stanislas Polu Date: Mon, 22 Jan 2024 09:28:14 +0100 Subject: [PATCH] core: debug upsertion failure (#3348) * core: debug upsertion failure * orer --- core/src/data_sources/data_source.rs | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/core/src/data_sources/data_source.rs b/core/src/data_sources/data_source.rs index 5518b2f36073..6ff2b7ced231 100644 --- a/core/src/data_sources/data_source.rs +++ b/core/src/data_sources/data_source.rs @@ -786,12 +786,34 @@ impl DataSource { )?; utils::done(&format!( - "Created document blob: data_source_id={} document_id={} duration={}ms", + "Created document blob: data_source_id={} document_id={} duration={}ms blob_url={}", self.data_source_id, document_id, - utils::now() - now + utils::now() - now, + format!("gs://{}/{}", bucket, content_path) )); + match document_id { + "notion-95804d6b-0274-43f6-8957-5b024234e3bf" => { + let debug_path = format!("{}/{}/debug.json", bucket_path, document_hash); + Object::create( + &bucket, + serde_json::to_string(&text).unwrap().into_bytes(), + &debug_path, + "application/json", + ) + .await?; + utils::done(&format!( + "Uploaded buggy document: data_source_id={} document_id={} debug_blob_url={}", + self.data_source_id, + document_id, + format!("gs://{}/{}", bucket, debug_path) + )); + panic!("BUGGY document `{}`", document_id); + } + _ => (), + }; + let now = utils::now(); // ChunkInfo is used to store the chunk text and associated hash to avoid recomputing the