[spanner-to-sourcedb] Add Integration Tests for retryDLQ and retryAllDLQ mode for sharded and non-sharded setup#3564
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Dead Letter Queue (DLQ) handling capabilities for DataStreamToSpanner and SpannerToSourceDb templates. It introduces a new 'one-shot' re-consumer for severe errors and a Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3564 +/- ##
============================================
+ Coverage 52.20% 52.49% +0.28%
- Complexity 6060 6225 +165
============================================
Files 1040 1062 +22
Lines 63059 64136 +1077
Branches 6912 7089 +177
============================================
+ Hits 32923 33666 +743
- Misses 27909 28188 +279
- Partials 2227 2282 +55
🚀 New features to boost your workflow:
|
2a84d50 to
4ef2077
Compare
...b/src/test/java/com/google/cloud/teleport/v2/templates/SpannerToSourceDBMySQLRetryDLQIT.java
Show resolved
Hide resolved
...b/src/test/java/com/google/cloud/teleport/v2/templates/SpannerToSourceDBMySQLRetryDLQIT.java
Show resolved
Hide resolved
...le/cloud/teleport/v2/templates/failureinjectiontesting/SpannerToSourceDBMySQLRetryDLQIT.java
Outdated
Show resolved
Hide resolved
...le/cloud/teleport/v2/templates/failureinjectiontesting/SpannerToSourceDBMySQLRetryDLQIT.java
Outdated
Show resolved
Hide resolved
...b/src/test/java/com/google/cloud/teleport/v2/templates/SpannerToSourceDBMySQLRetryDLQIT.java
Show resolved
Hide resolved
...le/cloud/teleport/v2/templates/failureinjectiontesting/SpannerToSourceDBMySQLRetryDLQIT.java
Outdated
Show resolved
Hide resolved
...eleport/v2/templates/failureinjectiontesting/SpannerToSourceDBShardedMySQLRetryAllDLQIT.java
Outdated
Show resolved
Hide resolved
...le/cloud/teleport/v2/templates/failureinjectiontesting/SpannerToSourceDBMySQLRetryDLQIT.java
Outdated
Show resolved
Hide resolved
v2/spanner-custom-shard/src/main/java/com/custom/SpannerToSourceDbRetryTransformation.java
Outdated
Show resolved
Hide resolved
v2/spanner-custom-shard/src/main/java/com/custom/SpannerToSourceDbRetryTransformation.java
Show resolved
Hide resolved
71cf1b5 to
46eaeea
Compare
46eaeea to
5fa3885
Compare
773499a to
e3556f6
Compare
...rc/test/java/com/google/cloud/teleport/v2/templates/SpannerToSourceDBMySQLRetryAllDLQIT.java
Show resolved
Hide resolved
...b/src/test/java/com/google/cloud/teleport/v2/templates/SpannerToSourceDBMySQLRetryDLQIT.java
Show resolved
Hide resolved
...rc/test/java/com/google/cloud/teleport/v2/templates/SpannerToSourceDBMySQLRetryAllDLQIT.java
Show resolved
Hide resolved
08725d3 to
203cfdb
Compare
b/457948107
This PR introduces comprehensive integration tests for the Dead Letter Queue (DLQ) retry mechanisms in the Spanner-to-Source Dataflow template. It adds end-to-end verification for both the concurrent batch retry flow (
retryDLQ) and the streaming retry flow (retryAllDLQ), covering both non-sharded and multi-shard schema routing scenarios.Tests Added
SpannerToSourceDBMySQLRetryDLQIT: Tests theretryDLQbatch job. Validates that it correctly processes and retries DLQ events alongside an actively running streaming pipeline by utilizing the activedlqPubSubConsumerflow. Uses the overrides file.SpannerToSourceDBMySQLRetryAllDLQIT: Tests theretryAllDLQbatch job. Validates that it correctly processes and retries ALL DLQ events offline when the main pipeline has been safely drained or stopped, utilizing the file-based consumer. Uses the overrides file.SpannerToSourceDBShardedMySQLRetryDLQIT: The sharded equivalent ofretryDLQ. Validates that the pipeline successfully evaluates nativemigration_shard_idcolumns in the source Spanner database to reliably route DLQ/retry events across multiple distributed target instances. Uses session file.SpannerToSourceDBShardedMySQLRetryAllDLQIT: The sharded equivalent ofretryAllDLQ. Validates the behavior of dynamic custom shard routing (where ShardIdColumn is not present) by relying on a custom Java shard ID fetcher. Uses overrides file.Features & Edge Cases Covered
severe/orretry/) error buckets without stalling progress.badmode tosemi-fixedmode.Test Setup & Simulated Schema Divergences
To accurately simulate volatile production environments, these integration tests operate against highly divergent test schemas between the Spanner source and MySQL target:
AllDataTypesreference table layout.