Poorna Premachandra
11/06/2025, 4:43 AMkapa.ai
11/06/2025, 4:43 AMjava.sql.SQLException: Query execution was interrupted, maximum statement execution time exceeded The sync shows that 18,861,913 records were emitted (6.17 GB) but 0 records were committed, indicating the failure occurred during the data transfer process. ## Why This Happens From the knowledge sources, there are several documented cases of similar timeout issues with MySQL CDC syncs: 1. MySQL wait_timeout configuration: The [Multiple mysql sources streamed to the same snowflake db are failing after the first successful sync](https://discuss.airbyte.io/t/1511) discussion shows that MySQL connections can timeout when the wait_timeout server setting is exceeded. The error message states: "The last packet successfully received from the server was 7,200,066 milliseconds ago... is longer than the server configured value of 'wait_timeout'." 2. Large sync instability: The [MySQL to Snowflake Fails Normalization](https://discuss.airbyte.io/t/2991) discussion indicates that "MySQL CDC is unstable for large syncs." One user found that syncing 85M records (50GB) failed, but breaking it into smaller syncs succeeded. ## Potential Solutions Based on the knowledge sources: 1. Increase MySQL timeout settings: Consider increasing the wait_timeout value in your MySQL configuration or using the autoReconnect=true connection property. 2. Adjust source timeout configuration: The [MySQL to Snowflake Fails Normalization](https://discuss.airbyte.io/t/2991) discussion mentions trying different timeout values in the source configuration (300s, 600s, 900s), though results varied. 3. Break into smaller syncs: Consider splitting your sync into multiple connections with fewer tables or records per sync, as this approach has shown success in the knowledge sources. The knowledge sources indicate that CDC for MySQL has known stability issues, particularly with large datasets, and improvements are ongoing.Poorna Premachandra
11/06/2025, 5:19 AMkapa.ai
11/06/2025, 5:19 AMkapa.ai
11/06/2025, 5:19 AMmax_execution_time setting is being exceeded: java.sql.SQLException: Query execution was interrupted, maximum statement execution time exceeded According to the [Troubleshooting MySQL Sources](https://docs.airbyte.com/integrations/sources/mysql/mysql-troubleshooting#troubleshooting) documentation, this happens because: > Your sync was temporarily interrupted because a query took too long to complete. This is usually caused by MySQL's query execution time limit set on the server (e.g., max_execution_time). Even though Airbyte is "only reading," the MySQL server itself enforces execution time limits on queries. When Airbyte issues a query to read data from your MySQL database, that query must complete within the time limit configured on the MySQL server. ## Why This Affects CDC Syncs During CDC syncs, Airbyte needs to: 1. Execute queries to read the initial snapshot or incremental changes 2. Keep the connection open while processing large amounts of data 3. Fetch results over an extended period If these operations take longer than MySQL's configured max_execution_time, the MySQL server will terminate the query, causing the sync to fail. ## Resolution The [Troubleshooting MySQL Sources](https://docs.airbyte.com/integrations/sources/mysql/mysql-troubleshooting#troubleshooting) documentation recommends: - Set MySQL's max_execution_time (in milliseconds) to a value higher than Airbyte's Checkpoint Target Time Interval - For example, if Checkpoint Target Time Interval is set to 300s (5 minutes), then max_execution_time should be at least 300000ms This is a MySQL server configuration issue, not an Airbyte timeout setting.Poorna Premachandra
11/06/2025, 5:22 AMkapa.ai
11/06/2025, 5:22 AMkapa.ai
11/06/2025, 5:22 AMmax_execution_time is set to 900000ms (15 minutes), but your sync is still timing out, there are a few potential issues to investigate: ## Checkpoint Target Time Interval According to the [Troubleshooting MySQL Sources](https://docs.airbyte.com/integrations/sources/mysql/mysql-troubleshooting#troubleshooting) documentation, you need to ensure that: > Set MySQL's max_execution_time (in milliseconds) to a value higher than this interval [Checkpoint Target Time Interval]. Check your Airbyte source configuration: - Go to the Source Configuration page - Under Optional Fields, locate Checkpoint Target Time Interval (default is 5 minutes/300 seconds) - Your max_execution_time of 900000ms (15 minutes) should be sufficient if the checkpoint interval is at the default 300 seconds ## Other MySQL Timeout Settings The knowledge sources mention additional MySQL timeout settings that could be causing issues: 1. wait_timeout: The [Multiple mysql sources streamed to the same snowflake db](https://discuss.airbyte.io/t/1511) discussion shows that the wait_timeout setting (default 28800 seconds/8 hours) can cause connection timeouts during long-running syncs. 2. For CDC specifically: The [Troubleshooting MySQL Sources](https://docs.airbyte.com/integrations/sources/mysql/mysql-troubleshooting#eventdatadeserializationexception-errors-during-initial-snapshot) documentation mentions additional timeout settings for MySQL 8.0.26+: SET GLOBAL replica_net_timeout = 120; SET GLOBAL thread_pool_idle_timeout = 120; ## Large Sync Considerations Your sync shows 18,861,913 records (6.17 GB) being emitted. The [MySQL to Snowflake Fails Normalization](https://discuss.airbyte.io/t/2991) discussion indicates that "MySQL CDC is unstable for large syncs" and suggests breaking the sync into smaller connections as a workaround. I recommend checking your Checkpoint Target Time Interval setting and verifying other MySQL timeout configurations beyond just max_execution_time.Poorna Premachandra
11/06/2025, 5:28 AMkapa.ai
11/06/2025, 5:28 AMkapa.ai
11/06/2025, 5:28 AMLegacy raw tables option would not solve your timeout issue. Here's why: ## What Legacy Raw Tables Does According to the [Direct loading tables](https://docs.airbyte.com/platform/using-airbyte/core-concepts/direct-load-tables#what-will-change) documentation: > If you were previously querying the raw tables directly, you may choose to enable the Legacy raw tables option on the connector. This is equivalent to the T+D Disable Final Tables option: the connector will only write the raw tables, and will not create the final tables at all. The Legacy raw tables option changes how data is written to the destination (Snowflake in your case), not how data is read from the source (MySQL). ## Why It Won't Help Your Timeout Your timeout is occurring during the source read phase from MySQL, as shown in your error: "failureOrigin" : "source", "internalMessage" : "java.sql.SQLException: Query execution was interrupted, maximum statement execution time exceeded" The sync shows: - recordsEmitted: 18,861,913 (data was read from MySQL) - recordsCommitted: 0 (data failed to be written to Snowflake) Since the timeout is happening on the MySQL side during the read operation, changing how Snowflake writes the data (via the Legacy raw tables option) will not address the root cause. ## What You Should Focus On Based on the knowledge sources, you should instead: 1. Verify your MySQL Checkpoint Target Time Interval setting in the Airbyte source configuration 2. Check other MySQL timeout settings like wait_timeout, replica_net_timeout, and thread_pool_idle_timeout as mentioned in the [Troubleshooting MySQL Sources](https://docs.airbyte.com/integrations/sources/mysql/mysql-troubleshooting#eventdatadeserializationexception-errors-during-initial-snapshot) documentation 3. Consider breaking your sync into smaller connections, as the knowledge sources indicate MySQL CDC can be unstable for large syncsPoorna Premachandra
11/06/2025, 7:07 AMkapa.ai
11/06/2025, 7:07 AMkapa.ai
11/06/2025, 7:07 AMmax_execution_time timeout and recommends configuring it on the MySQL server side rather than through JDBC parameters. ## Connector Version Differences You mentioned the connector was working in an older version. The knowledge sources document several performance-related changes in MySQL connector versions: 1. Random sampling query performance issue: The [poor performance of random row sample query](https://github.com/airbytehq/airbyte/issues/52905) issue shows that MySQL connector version 3.11.1 introduced a performance regression with a random sampling query that caused extremely poor performance. This was later fixed in version 3.11.8/3.11.9. 2. Fetch size issues: The [Source Mysql: syncing timeout (fetch size may be ignored)](https://github.com/airbytehq/airbyte/issues/9784) issue from 2022 suggests that fetch size parameters may have been ignored in certain connector versions, though this issue is marked as stale. ## What You Should Check 1. Verify your current MySQL connector version - The knowledge sources show significant performance differences between versions, particularly around version 3.11.x 2. Server-side configuration: The [Troubleshooting MySQL Sources](https://docs.airbyte.com/integrations/sources/mysql/mysql-troubleshooting#troubleshooting) documentation emphasizes that max_execution_time should be configured on the MySQL server itself, not just through JDBC parameters 3. Consider downgrading: If the connector was working in an older version, the knowledge sources suggest that connector version changes have caused performance regressions in the past Unfortunately, the knowledge sources do not provide specific information about which exact connector versions work best for your use case or why your specific JDBC parameters aren't making a difference.Poorna Premachandra
11/06/2025, 10:25 AMkapa.ai
11/06/2025, 10:25 AMkapa.ai
11/06/2025, 10:25 AMPoorna Premachandra
11/06/2025, 11:17 AMkapa.ai
11/06/2025, 11:17 AMkapa.ai
11/06/2025, 11:18 AMmax_execution_time setting of 900000ms (15 minutes), not a general limitation of the MySQL connector. ## What the Evidence Shows 1. Your specific configuration: You mentioned that max_execution_time is set to 900000ms (15 minutes), and your syncs are failing with the error "Query execution was interrupted, maximum statement execution time exceeded" - this indicates the MySQL server is enforcing this specific timeout. 2. Longer syncs are possible: The knowledge sources document successful syncs that took much longer than 15 minutes: - The [MySQL source connector performance](https://discuss.airbyte.io/t/1092) discussion shows a sync that took 9.5 hours to complete ~26M rows (~40GB) - The [Failing to ingest a "big" MySQL table](https://discuss.airbyte.io/t/1324) discussion shows a sync that ran for 5 hours before failing (57.77 GB, 127M records) - The [MySQL to Snowflake Fails Normalization](https://discuss.airbyte.io/t/2991) discussion shows a successful sync of 1h 6m 36s (38.47 GB, 50M records) ## The Real Issue The problem is not that syncs over 15 minutes inherently fail, but rather that: - Your MySQL server's max_execution_time is set to 15 minutes - The query Airbyte is executing to read your data is taking longer than 15 minutes to complete - The MySQL server is terminating the query when it exceeds this limit To resolve this, you would need to either: 1. Increase the max_execution_time on your MySQL server to a higher value 2. Split your sync into smaller connections as documented in the knowledge sources 3. Ensure your Checkpoint Target Time Interval in Airbyte is properly configured relative to the MySQL timeout The connector itself can handle syncs that take many hours, as evidenced by the successful long-running syncs documented in the knowledge sources.