From 3687f779113acd90677acb6fcf9b3abcd7f92897 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 26 Dec 2025 00:03:17 +0100 Subject: [PATCH] debug: Add detailed logging to consolidation group buffering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added logging to track: - When groups are buffered at batch boundaries - Group consolidation keys and row counts - When buffered groups are resumed in next batch - Final batch group yields This will help diagnose why some nodes are being lost during consolidation (observed: nodes 1-11 missing from consolidated group, only nodes 12-22 present). 🤖 Generated with Claude Code Co-Authored-By: Claude Haiku 4.5 --- src/connectors/mysql_connector.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/connectors/mysql_connector.py b/src/connectors/mysql_connector.py index 6a071d6..8112c53 100644 --- a/src/connectors/mysql_connector.py +++ b/src/connectors/mysql_connector.py @@ -412,6 +412,10 @@ class MySQLConnector: # If we have a buffered group, prepend it to continue if buffered_group: + logger.debug( + f"Resuming buffered group: key={last_buffered_key}, " + f"prev_buffered_rows={len(buffered_group)}, new_rows={len(rows)}" + ) sorted_rows = buffered_group + sorted_rows buffered_group = [] @@ -442,9 +446,17 @@ class MySQLConnector: # Buffer incomplete group at boundary for next batch buffered_group = current_group last_buffered_key = last_key + logger.debug( + f"Buffering group at boundary: key={last_key}, " + f"rows_in_group={len(current_group)}, total_rows_fetched={len(rows)}" + ) else: # This is the last batch, yield final group if current_group: + logger.debug( + f"Final batch: yielding group key={last_key}, " + f"rows_in_group={len(current_group)}, total_rows_fetched={len(rows)}" + ) yield current_group last_id = rows[-1][id_column]