support default primary key detection for mysql for int/temporal types#4440
Conversation
ea632d8 to
f1df47e
Compare
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
❌ Test FailureAnalysis: The PR's own new test Test_MySQL_Default_Partition_Key_Parallel_Snapshot deterministically times out during snapshot (STATUS_SNAPSHOT) in multiple matrix legs, indicating a real bug in the new MySQL default-partition-key parallel-snapshot feature rather than flakiness. |
f1df47e to
57e75a7
Compare
🔄 Flaky Test DetectedAnalysis: The test failed on a non-retried assertion (require.Greater, "1 is not greater than 1") that races against Temporal's eventually-consistent ListWorkflow visibility indexing, and failed in only one of several parallel matrix jobs—both hallmarks of a flaky timing race rather than a real bug. ✅ Automatically retrying the workflow |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
| } | ||
|
|
||
| var tableSchemaMapping map[string]*protos.TableSchema | ||
| if srcType == protos.DBType_MYSQL { |
There was a problem hiding this comment.
Any reason not to have all of this logic in the connector?
There was a problem hiding this comment.
mainly because it would require passing in the catalog pool to the connector method (needed by LoadTableSchemasFromCatalog); and in general it's cleaner separation of concern to have the connector focus on source db logic, while the generic activity handling the catalog logic. Note that there are already existing exceptions like PullRecords/PullQRepRecords, but trying not to introduce more of it.
The mysql-specific PeerDBMySQLDefaultPartitionKeyEnabled check being here is a bit awkward, but it will be removed once this feature stabilizes.
There was a problem hiding this comment.
I think it's totally fine to introduce extra args that the connector is welcome to use or not use. The purpose of shared skeleton and interfaced connectors is that the skeleton doesn't have to have type switches. Very possible that better abstractions are out there but this one arg change doesn't seem like it's make things messy at all
57e75a7 to
e941378
Compare
When custom partition key is not specified, determine default partition key based on table's primary key. If the primary key(s) starts with an integer or temporal type, perform parallel snapshot instead of full table snapshot.
Testing:
Fixes: DBI-867