Skip to content

Commit

Permalink
add logging to help troubleshoot
Browse files Browse the repository at this point in the history
  • Loading branch information
imor committed Nov 30, 2024
1 parent 83e47b2 commit 0cf109e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pg_replicate/src/conversions/table_row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::str::Utf8Error;

use thiserror::Error;
use tokio_postgres::types::Type;
use tracing::error;
use tracing::{error, info};

use crate::{conversions::text::TextFormatConverter, pipeline::batching::BatchBoundary};

Expand Down Expand Up @@ -48,6 +48,7 @@ impl TableRowConverter {
let mut values = Vec::with_capacity(column_schemas.len());

let row_str = str::from_utf8(row)?;
info!("row_str: {row_str}");
let mut column_schemas_iter = column_schemas.iter();
let mut chars = row_str.chars();
let mut val_str = String::with_capacity(10);
Expand Down Expand Up @@ -93,6 +94,7 @@ impl TableRowConverter {
return Err(TableRowConversionError::NumColsMismatch);
};

info!("val_str: {val_str:#?}");
let value = if val_str == "\\N" {
Cell::Null
} else {
Expand Down
2 changes: 2 additions & 0 deletions pg_replicate/src/pipeline/batching/data_pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ impl<Src: Source, Snk: BatchSink> BatchDataPipeline<Src, Snk> {
continue;
}

info!("table schema: {table_schema:#?}");

self.sink.truncate_table(table_schema.table_id).await?;

let table_rows = self
Expand Down

0 comments on commit 0cf109e

Please sign in to comment.