feat(resync): Add support to update snapshot config (max_parallel_workers, num_tables, rows_per_partition) during resync signal#4276
Conversation
🔄 Flaky Test DetectedAnalysis: The failure is a transient Docker container initialization error for the mysql-gtid 6.0 lts matrix variant — no tests ran at all, all test steps were skipped, while all sibling matrix jobs passed in the same run. ✅ Automatically retrying the workflow |
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
View the full list of 2 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
🔄 Flaky Test DetectedAnalysis: TestPostgresSSHKeepaliveLatency panicked with "watch already in progress" — a race condition in pgx's context watcher during SSH keepalive connection close — crashing the entire connectors/postgres test binary and marking all sibling tests as failed with unknown status. ✅ Automatically retrying the workflow |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This comment was marked as resolved.
This comment was marked as resolved.
…kers, num_tables, rows_per_partition) during resync signal
This comment was marked as resolved.
This comment was marked as resolved.
| changes = append(changes, fmt.Sprintf("tables removed: %v", removedTables)) | ||
| } | ||
|
|
||
| if update.SnapshotMaxParallelWorkers > 0 { |
There was a problem hiding this comment.
thanks for adding this to activity logging as well!
There was a problem hiding this comment.
nit: for same of completion, let's include batchSize, idleTimeout, snapshotNumPartitionsOverride to match LogActivityUpdateFlowConfig
There was a problem hiding this comment.
// Only logging fields that don't need old values to compare to
The caller here will actually pass all values, changed and unchanged, and the flow-api can't distinguish which ones to log. Logging the list of tables has to happen here because they're not applied to the config until snapshotting is done, so keeping just tables and leaving the rest to the worker is better.
| // Override Snapshot Parameters | ||
| overrideSnapshotParametersInResync(req, config) |
There was a problem hiding this comment.
nit: i may regret saying this (lol) but for now we are not validating these snapshot parameters so we could just remove it altogether.
maybe can add a comment here mentioning that. this avoids having update these config fields.
|
missing e2e test for this to ensure that resync propagates snapshot config changes |
This comment was marked as outdated.
This comment was marked as outdated.
pfcoperez
left a comment
There was a problem hiding this comment.
Changes LGTM except for the seemingly unused method. I also wonder if we can unit test the config extraction, basically checking the right fields are extracted from a test.
jgao54
left a comment
There was a problem hiding this comment.
lgtm as well once @pfcoperez 's comment is addressed :) !
❌ Test FailureAnalysis: The newly-added TestResyncWithSnapshotConfigOverride fails deterministically across all 9 matrix combinations (3 DB versions x 3 API sub-suites) with the same logical error "unable to signal workflow update: workflow execution already completed" — indicating a real bug in the new resync-signal feature on this PR, not transient flakiness. |
❌ Test FailureAnalysis: TestResyncWithSnapshotConfigOnResyningPipe fails identically across MySQL/Postgres/Mongo with "UNEXPECTED TIMEOUT wait for mirror to be in cdc" — this directly tests the feature added by the PR (resync snapshot config override), indicating a real bug in the resync→cdc transition, not flakiness. |
❌ Test FailureAnalysis: TestApiMy/TestResyncWithSnapshotConfigDuringSnapshot fails deterministically across all three MySQL/MariaDB matrix jobs with the same SQL syntax error near '(1,2000) g' (PostgreSQL generate_series syntax executed against MySQL), indicating a real code bug rather than flakiness. |
Code reviewFound 1 issue. Checked for bugs and CLAUDE.md compliance. |
🔄 Flaky Test DetectedAnalysis: TestGenericCH_PG/Test_Initial_Custom_Partition failed because the catalog Postgres connection was terminated mid-test with SQLSTATE 57P01 (admin_shutdown), a transient infrastructure issue rather than a code bug. ✅ Automatically retrying the workflow |
🔄 Flaky Test DetectedAnalysis: Catalog Postgres connection terminated mid-test with SQLSTATE 57P01 (admin_shutdown) — a transient infrastructure error unrelated to the test's logic, failing only 1 of 2448 tests in a single shard. ✅ Automatically retrying the workflow |
🔄 Flaky Test DetectedAnalysis: TestApiMy/TestResyncWithSnapshotConfigOnRunningPipe hit an "UNEXPECTED TIMEOUT wait for flow dropped" (60s) on the mysql-gtid/6.0 matrix variant only, while the maria/8.0 and mysql-pos/7.0 jobs passed — timing/async-completion flakiness rather than a logic bug. ✅ Automatically retrying the workflow |
| changes = append(changes, fmt.Sprintf("tables removed: %v", removedTables)) | ||
| } | ||
|
|
||
| if update.SnapshotMaxParallelWorkers > 0 { |
There was a problem hiding this comment.
// Only logging fields that don't need old values to compare to
The caller here will actually pass all values, changed and unchanged, and the flow-api can't distinguish which ones to log. Logging the list of tables has to happen here because they're not applied to the config until snapshotting is done, so keeping just tables and leaving the rest to the worker is better.
|
|
||
| // We still override the snapshot parameters (when resync with updated values) | ||
| overrideSnapshotParametersInState(val, state) | ||
| resyncCfg := syncStateToConfigProtoInCatalog(ctx, cfg, state) |
There was a problem hiding this comment.
Comments just above mention needing to not sync the tableMappings to catalog because they have _resync at the end, and syncStateToConfigProtoInCatalog does exactly that
There was a problem hiding this comment.
To avoid without code duplication, can move applySnapshotConfigOverrides to internal, change it to ConfigsCore, and inline the h.ValidateCDCMirror call to be able to pass ConfigsCore earlier. Then this one can be
internal.ApplySnapshotConfigOverrides(cfg, val.GetFlowConfigUpdate().GetCdcFlowConfigUpdate())
uploadConfigToCatalog(ctx, cfg)There was a problem hiding this comment.
The whole signal + mutable state thing is a mess so I understand that it's very confusing to deal with
🔄 Flaky Test DetectedAnalysis: TestApiPg/TestPostgresTableOIDsMigration failed with PostgreSQL SQLSTATE 57P01 (terminating connection due to administrator command) — an infrastructure-level connection kill rather than a test logic failure, consistent with flaky CI behavior. ✅ Automatically retrying the workflow |
Tested scenarios:
Initial + CDC Pipes:
Initial only Pipes:
CDC Only Pipes: