-
Notifications
You must be signed in to change notification settings - Fork 923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added dlq implementation v1 #1577
added dlq implementation v1 #1577
Conversation
331d139
to
d19d4af
Compare
a924da3
to
492a0bb
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1577 +/- ##
============================================
+ Coverage 40.93% 43.54% +2.61%
+ Complexity 2808 654 -2154
============================================
Files 739 294 -445
Lines 42855 15542 -27313
Branches 4582 1548 -3034
============================================
- Hits 17542 6768 -10774
+ Misses 23814 8255 -15559
+ Partials 1499 519 -980
|
...spanner/src/main/java/com/google/cloud/teleport/v2/templates/SourceDbToSpannerConstants.java
Outdated
Show resolved
Hide resolved
...-spanner/src/main/java/com/google/cloud/teleport/v2/transformer/SourceRowToMutationDoFn.java
Show resolved
Hide resolved
...on/src/main/java/com/google/cloud/teleport/v2/spanner/migrations/avro/AvroToValueMapper.java
Show resolved
Hide resolved
v2/sourcedb-to-spanner/src/main/java/com/google/cloud/teleport/v2/writer/SpannerWriter.java
Outdated
Show resolved
Hide resolved
v2/sourcedb-to-spanner/src/main/java/com/google/cloud/teleport/v2/writer/DeadLetterQueue.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we structure this a little better? The code flow is very hard to understand, especially wrt how failed mutations and failed transformations are getting written to the DLQ.
We used TupleTag
for transformer errors to collect the errors and we directly write the records for mutation errors. We should be consistent.
IMO if we should collect the failed records, attributed to the failure reason (transform, retryable, permanent etc) and then write them out to a DLQ...
The PCollections of all types of errors (categorized by permanent or retryable) can be merged and the DLQ can be written in a single stage, something like -
// example for class of permanent errors
PCollectionList.of(errorTransformedRecords)
.and(spannerWriteResults.permanentErrors())
.apply(Flatten.pCollections())
.apply(DLQWriteTransform....)
...-to-spanner/src/main/java/com/google/cloud/teleport/v2/options/SourceDbToSpannerOptions.java
Outdated
Show resolved
Hide resolved
v2/sourcedb-to-spanner/src/main/java/com/google/cloud/teleport/v2/templates/RowContext.java
Show resolved
Hide resolved
...rcedb-to-spanner/src/main/java/com/google/cloud/teleport/v2/templates/SourceDbToSpanner.java
Outdated
Show resolved
Hide resolved
...rcedb-to-spanner/src/main/java/com/google/cloud/teleport/v2/templates/SourceDbToSpanner.java
Outdated
Show resolved
Hide resolved
...-spanner/src/main/java/com/google/cloud/teleport/v2/transformer/SourceRowToMutationDoFn.java
Outdated
Show resolved
Hide resolved
v2/sourcedb-to-spanner/src/main/java/com/google/cloud/teleport/v2/writer/DeadLetterQueue.java
Show resolved
Hide resolved
v2/sourcedb-to-spanner/src/main/java/com/google/cloud/teleport/v2/writer/SpannerWriter.java
Show resolved
Hide resolved
...rcedb-to-spanner/src/main/java/com/google/cloud/teleport/v2/templates/SourceDbToSpanner.java
Outdated
Show resolved
Hide resolved
v2/sourcedb-to-spanner/src/main/java/com/google/cloud/teleport/v2/writer/DeadLetterQueue.java
Show resolved
Hide resolved
v2/sourcedb-to-spanner/src/main/java/com/google/cloud/teleport/v2/writer/DeadLetterQueue.java
Show resolved
Hide resolved
That was the original idea, but this is currently not possible in this flow owing to the different objects being created. I will catch up with you to explain. |
37b02a6
to
d6ec29c
Compare
spotless apply checkstyle violation fixes fixed tests fixed tests corrected checkstyle added tests moved constants updated javadocs addressed review comments addressed review comments addressed review comments
d6ec29c
to
b2846e1
Compare
updated codecov added tests on avro mapper removed unused code from Spanner Writer spotless run
b1c95a4
to
c650fd9
Compare
5d3d94d
into
GoogleCloudPlatform:main
Added support for writing errors to DLQ.
This PR does not include the files in a format that can be retried using the existing retrial scripts. That will be taken up in a follow up PR.