From 6343b0fac8c73c8e2ec32cb48049caf85d67672c Mon Sep 17 00:00:00 2001 From: Ertugrul Aypek Date: Sat, 28 Sep 2024 22:31:01 +0200 Subject: [PATCH] remove debug logs --- iris-mpc-gpu/src/server/actor.rs | 27 ++++++++++++--------------- iris-mpc-store/src/lib.rs | 22 +++++++++------------- iris-mpc/src/bin/server.rs | 15 +-------------- 3 files changed, 22 insertions(+), 42 deletions(-) diff --git a/iris-mpc-gpu/src/server/actor.rs b/iris-mpc-gpu/src/server/actor.rs index 6702d75a6..7c13794ec 100644 --- a/iris-mpc-gpu/src/server/actor.rs +++ b/iris-mpc-gpu/src/server/actor.rs @@ -821,22 +821,19 @@ impl ServerActor { } ); - tracing::info!("Merged results: {:?}", merged_results); - tracing::info!("Matches: {:?}", matches); - let res = ServerJobResult { - merged_results, - request_ids: batch.request_ids, - metadata: batch.metadata, - matches, - match_ids, - store_left: query_store_left, - store_right: query_store_right, - deleted_ids: batch.deletion_requests_indices, - }; - tracing::info!("Res: {:?}", res); - // Pass to internal sender thread - return_channel.send(res).unwrap(); + return_channel + .send(ServerJobResult { + merged_results, + request_ids: batch.request_ids, + metadata: batch.metadata, + matches, + match_ids, + store_left: query_store_left, + store_right: query_store_right, + deleted_ids: batch.deletion_requests_indices, + }) + .unwrap(); // Wait for all streams before get timings self.device_manager.await_streams(&self.streams[0]); diff --git a/iris-mpc-store/src/lib.rs b/iris-mpc-store/src/lib.rs index 9bfc472ea..51f2d2425 100644 --- a/iris-mpc-store/src/lib.rs +++ b/iris-mpc-store/src/lib.rs @@ -121,8 +121,7 @@ impl Store { Ok(Store { pool }) } - pub async fn tx(&self, func_name: &str) -> Result> { - tracing::info!("Starting transaction for {}", func_name); + pub async fn tx(&self) -> Result> { Ok(self.pool.begin().await?) } @@ -319,10 +318,7 @@ DO UPDATE SET right_code = EXCLUDED.right_code, right_mask = EXCLUDED.right_mask query.push_bind(result); }); - tracing::info!("Before insert_results execution"); query.build().execute(tx.deref_mut()).await?; - tracing::info!("After insert_results execution"); - Ok(()) } @@ -384,7 +380,7 @@ DO UPDATE SET right_code = EXCLUDED.right_code, right_mask = EXCLUDED.right_mask self.rollback(0).await?; } - let mut tx = self.tx("init_db_with_random_shares").await?; + let mut tx = self.tx().await?; tracing::info!( "DB size before initialization: {}", @@ -424,7 +420,7 @@ DO UPDATE SET right_code = EXCLUDED.right_code, right_mask = EXCLUDED.right_mask if (i % 1000) == 0 { tx.commit().await?; - tx = self.tx("init_db_with_random_shares i % 1000").await?; + tx = self.tx().await?; } } tracing::info!("Completed initialization of iris db, committing..."); @@ -497,7 +493,7 @@ mod tests { right_mask: &[], }, ]; - let mut tx = store.tx("test").await?; + let mut tx = store.tx().await?; store.insert_irises(&mut tx, &codes_and_masks[0..2]).await?; store.insert_irises(&mut tx, &codes_and_masks[2..3]).await?; tx.commit().await?; @@ -529,7 +525,7 @@ mod tests { let schema_name = temporary_name(); let store = Store::new(&test_db_url()?, &schema_name).await?; - let mut tx = store.tx("test").await?; + let mut tx = store.tx().await?; store.insert_results(&mut tx, &[]).await?; store.insert_irises(&mut tx, &[]).await?; tx.commit().await?; @@ -563,7 +559,7 @@ mod tests { ))?; let result_events = vec![result_event; count]; - let mut tx = store.tx("test").await?; + let mut tx = store.tx().await?; store.insert_results(&mut tx, &result_events).await?; store.insert_irises(&mut tx, &codes_and_masks).await?; tx.commit().await?; @@ -618,7 +614,7 @@ mod tests { right_mask: &[101_u16; 12800], }; - let mut tx = store.tx("test").await?; + let mut tx = store.tx().await?; store.insert_irises(&mut tx, &vec![iris; 10]).await?; tx.commit().await?; store.rollback(5).await?; @@ -637,7 +633,7 @@ mod tests { let store = Store::new(&test_db_url()?, &schema_name).await?; let result_events = vec!["event1".to_string(), "event2".to_string()]; - let mut tx = store.tx("test").await?; + let mut tx = store.tx().await?; store.insert_results(&mut tx, &result_events).await?; store.insert_results(&mut tx, &result_events).await?; tx.commit().await?; @@ -755,7 +751,7 @@ mod tests { right_code: &[789_u16; 12800], right_mask: &[101_u16; 6400], }; - let mut tx = store.tx("test").await?; + let mut tx = store.tx().await?; store.insert_irises(&mut tx, &vec![iris.clone(); 2]).await?; tx.commit().await?; diff --git a/iris-mpc/src/bin/server.rs b/iris-mpc/src/bin/server.rs index 93e2eb9fc..79ac73698 100644 --- a/iris-mpc/src/bin/server.rs +++ b/iris-mpc/src/bin/server.rs @@ -721,15 +721,12 @@ async fn server_main(config: Config) -> eyre::Result<()> { background_tasks.check_tasks(); - tracing::info!("Start thread that will be responsible for communicating back the results"); - // Start thread that will be responsible for communicating back the results let (tx, mut rx) = mpsc::channel::(32); // TODO: pick some buffer value let sns_client_bg = sns_client.clone(); let config_bg = config.clone(); let store_bg = store.clone(); let _result_sender_abort = background_tasks.spawn(async move { - tracing::info!("In _result_sender_abort"); while let Some(ServerJobResult { merged_results, request_ids, @@ -741,7 +738,6 @@ async fn server_main(config: Config) -> eyre::Result<()> { deleted_ids, }) = rx.recv().await { - tracing::info!("Received results for {} queries", request_ids.len()); // returned serial_ids are 0 indexed, but we want them to be 1 indexed let uniqueness_results = merged_results .iter() @@ -760,14 +756,10 @@ async fn server_main(config: Config) -> eyre::Result<()> { false => None, }, ); - tracing::info!("result_event: {:?}", result_event); - serde_json::to_string(&result_event).wrap_err("failed to serialize result") }) .collect::>>()?; - tracing::info!("uniqueness_results: {:?}", uniqueness_results); - // Insert non-matching queries into the persistent store. let (memory_serial_ids, codes_and_masks): (Vec, Vec) = matches .iter() @@ -787,14 +779,11 @@ async fn server_main(config: Config) -> eyre::Result<()> { }) .unzip(); - tracing::info!("Start awaiting store_bg tx"); - let mut tx = store_bg.tx("server.rs").await?; - tracing::info!("End awaiting store_bg tx"); + let mut tx = store_bg.tx().await?; store_bg .insert_results(&mut tx, &uniqueness_results) .await?; - tracing::info!("Inserted results"); if !codes_and_masks.is_empty() { let db_serial_ids = store_bg @@ -820,9 +809,7 @@ async fn server_main(config: Config) -> eyre::Result<()> { } } - tracing::info!("Before tx.commit().await"); tx.commit().await?; - tracing::info!("After tx.commit().await"); tracing::info!("Sending {} uniqueness results", uniqueness_results.len()); send_results_to_sns(