Skip to content

error classification: classify a transient mysql error#4362

Merged
jgao54 merged 2 commits into
mainfrom
invalid-compress-sequence
Jun 2, 2026
Merged

error classification: classify a transient mysql error#4362
jgao54 merged 2 commits into
mainfrom
invalid-compress-sequence

Conversation

@jgao54

@jgao54 jgao54 commented May 28, 2026

Copy link
Copy Markdown
Contributor
  • Rename to from MySQLStreamingError to MySQLExecuteError to be more general (this covers Execute, ExecuteSelectStreaming, as well errors coming from syncer.StartSync and syncer.StartSyncGTID), basically upstream execution protocol related errors
  • Make the invalid compressed sequence error retryable (both at the query level, and at the error classification level, in case the states in the existing conn is broken and recreating the connector is required)
  • Make functions like Execute and ExecuteSelectStreaming in mysql.go returnMySQLExecuteError, instead of having to wrap it at every caller.

Fixes: DBI-769

@jgao54 jgao54 requested a review from a team as a code owner May 28, 2026 21:28
@jgao54 jgao54 marked this pull request as draft May 28, 2026 21:31
@claude

claude Bot commented May 28, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@jgao54 jgao54 force-pushed the invalid-compress-sequence branch from b4c7817 to dbeb9e7 Compare May 28, 2026 21:44
@codecov

codecov Bot commented May 28, 2026

Copy link
Copy Markdown

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
2281 2 2279 189
View the top 2 failed test(s) by shortest run time
github.com/PeerDB-io/peerdb/flow/e2e::TestGenericPG
Stack Traces | 0.01s run time
=== RUN   TestGenericPG
=== PAUSE TestGenericPG
=== CONT  TestGenericPG
--- FAIL: TestGenericPG (0.01s)
github.com/PeerDB-io/peerdb/flow/e2e::TestGenericPG/Test_Inheritance_Table_Without_Dynamic_Setting
Stack Traces | 31.1s run time
=== RUN   TestGenericPG/Test_Inheritance_Table_Without_Dynamic_Setting
=== PAUSE TestGenericPG/Test_Inheritance_Table_Without_Dynamic_Setting
=== CONT  TestGenericPG/Test_Inheritance_Table_Without_Dynamic_Setting
2026/05/28 21:37:01 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id FROM e2e_test_pg_mentophd.\"test_ddl_drop_column\" ORDER BY id"
2026/05/28 21:37:01 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id FROM e2e_test_pg_mentophd.\"test_ddl_drop_column\" ORDER BY id"
2026/05/28 21:37:01 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursorQuery="DECLARE peerdb_cursor_14725509670699016772 CURSOR FOR SELECT id FROM e2e_test_pg_mentophd.\"test_ddl_drop_column\" ORDER BY id" args=[]
2026/05/28 21:37:01 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id FROM e2e_test_pg_mentophd.\"test_ddl_drop_column\" ORDER BY id" channelLen=0
2026/05/28 21:37:01 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_14725509670699016772
2026/05/28 21:37:01 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_14725509670699016772 records=1 bytes=4 channelLen=0
2026/05/28 21:37:01 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id FROM e2e_test_pg_mentophd.\"test_ddl_drop_column\" ORDER BY id" rows=1 bytes=4 channelLen=0
2026/05/28 21:37:01 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_14725509670699016772
2026/05/28 21:37:01 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_14725509670699016772 records=0 bytes=0 channelLen=0
2026/05/28 21:37:01 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id FROM e2e_test_pg_mentophd.\"test_ddl_drop_column\" ORDER BY id" rows=0 bytes=0 channelLen=0
2026/05/28 21:37:01 INFO [pg_query_executor] committing transaction x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart
2026/05/28 21:37:01 INFO [pg_query_executor] committed transaction for query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id FROM e2e_test_pg_mentophd.\"test_ddl_drop_column\" ORDER BY id" rows=1 bytes=4 channelLen=0
2026/05/28 21:37:01 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id FROM e2e_test_pg_mentophd.\"test_ddl_drop_column_dst\" ORDER BY id"
2026/05/28 21:37:01 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id FROM e2e_test_pg_mentophd.\"test_ddl_drop_column_dst\" ORDER BY id"
2026/05/28 21:37:01 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursorQuery="DECLARE peerdb_cursor_1047765999002098330 CURSOR FOR SELECT id FROM e2e_test_pg_mentophd.\"test_ddl_drop_column_dst\" ORDER BY id" args=[]
2026/05/28 21:37:01 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id FROM e2e_test_pg_mentophd.\"test_ddl_drop_column_dst\" ORDER BY id" channelLen=0
2026/05/28 21:37:01 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_1047765999002098330
2026/05/28 21:37:01 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_1047765999002098330 records=1 bytes=4 channelLen=0
2026/05/28 21:37:01 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id FROM e2e_test_pg_mentophd.\"test_ddl_drop_column_dst\" ORDER BY id" rows=1 bytes=4 channelLen=0
2026/05/28 21:37:01 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_1047765999002098330
2026/05/28 21:37:01 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_1047765999002098330 records=0 bytes=0 channelLen=0
2026/05/28 21:37:01 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id FROM e2e_test_pg_mentophd.\"test_ddl_drop_column_dst\" ORDER BY id" rows=0 bytes=0 channelLen=0
2026/05/28 21:37:01 INFO [pg_query_executor] committing transaction x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart
2026/05/28 21:37:01 INFO [pg_query_executor] committed transaction for query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id FROM e2e_test_pg_mentophd.\"test_ddl_drop_column_dst\" ORDER BY id" rows=1 bytes=4 channelLen=0
    generic_test.go:1044: UNEXPECTED STATUS TIMEOUT STATUS_SNAPSHOT
    postgres.go:92: begin tearing down postgres schema pg_u0kwalgy
--- FAIL: TestGenericPG/Test_Inheritance_Table_Without_Dynamic_Setting (31.14s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: TestGenericPG/Test_Inheritance_Table_Without_Dynamic_Setting timed out waiting for CDC status to transition past STATUS_SNAPSHOT — a PostgreSQL CDC test unrelated to this PR's MySQL error-classification changes, and only one of three matrix jobs failed, indicating a flaky snapshot timeout under high test concurrency.
Confidence: 0.9

✅ Automatically retrying the workflow

View workflow run

@jgao54 jgao54 force-pushed the invalid-compress-sequence branch from dbeb9e7 to 9db8572 Compare May 28, 2026 21:59
@jgao54 jgao54 force-pushed the invalid-compress-sequence branch from 9db8572 to d925196 Compare May 28, 2026 22:23
@jgao54 jgao54 marked this pull request as ready for review May 28, 2026 22:29
Comment thread flow/connectors/mysql/mysql.go Outdated
if mysql.ErrorEqual(err, mysql.ErrBadConn) || exceptions.InvalidSequenceRe.MatchString(err.Error()) {
if mysql.ErrorEqual(err, mysql.ErrBadConn) ||
exceptions.InvalidSequenceRe.MatchString(err.Error()) ||
exceptions.InvalidCompressedSequenceRe.MatchString(err.Error()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just from the verbosity standpoint, should we merge the two regexes?

@jgao54 jgao54 enabled auto-merge (squash) June 1, 2026 23:59
@jgao54 jgao54 merged commit e172e45 into main Jun 2, 2026
14 checks passed
@jgao54 jgao54 deleted the invalid-compress-sequence branch June 2, 2026 00:19
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.

2 participants