Skip to content

Conversation

@lorenarosati
Copy link
Collaborator

@lorenarosati lorenarosati commented Jan 22, 2026

What changes are proposed in this pull request?

fix: #1640
This PR adds tracing at the end of phase 1 of CDF to help with debugging errors.

How was this change tested?

Added a test to check that all the tracing statements are found in the logs.

@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 72.72727% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.63%. Comparing base (bbaef1a) to head (800365d).

Files with missing lines Patch % Lines
kernel/src/table_changes/log_replay.rs 50.00% 3 Missing ⚠️
test-utils/src/lib.rs 81.25% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1654      +/-   ##
==========================================
- Coverage   84.63%   84.63%   -0.01%     
==========================================
  Files         125      125              
  Lines       34724    34745      +21     
  Branches    34724    34745      +21     
==========================================
+ Hits        29390    29405      +15     
- Misses       3983     3989       +6     
  Partials     1351     1351              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lorenarosati lorenarosati marked this pull request as ready for review January 23, 2026 17:50
Comment on lines 998 to 1007
let logs = Arc::new(Mutex::new(Vec::new()));
let logs_clone = logs.clone();

let subscriber = tracing_subscriber::registry().with(
tracing_subscriber::fmt::layer()
.with_writer(move || LogWriter(logs_clone.clone()))
.with_ansi(false),
);

let _guard = tracing::subscriber::set_default(subscriber);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also noticing that we're duplicating this. Maybe make this a helper function for setting up a logging test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just added!

Comment on lines +1024 to +1036
let commits = get_segment(engine.as_ref(), mock_table.table_root(), 0, None)
.unwrap()
.into_iter();

let table_root_url = url::Url::from_directory_path(mock_table.table_root()).unwrap();
let table_config = get_default_table_config(&table_root_url);

let _scan_batches: DeltaResult<Vec<_>> =
table_changes_action_iter(engine, &table_config, commits, get_schema().into(), None)
.unwrap()
.try_collect();

let log_output = tracing_guard.logs();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added LoggingTest to reduce some duplication of the logging setup as suggested, but also noticed that the tests are still quite similar in structure. I thought about extracting out basically this logic to another function, but I figure that other tests for tracing might have slightly different structures and this might not be necessary if it'll only be used for these four tests that have been added. Let me know if you think I should add this though!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah it's not the best. A lot of it is from the poor formatting of mock_table's stuff 😔 Since the tests in that module are generally similar, I think this is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add CDF tracing for Phase 2 of Change Data feed

2 participants