[App Update] Add the logic to ensure tap-postgres always return 1 row #8
+52
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://kaligo.atlassian.net/browse/LOYAL-12052
Background
Recently, we are facing the replication issue on the UAT RC-US (this)
Most of the checks are related to the table
activity_trackings
This is because
sdc_batched_at
of this table hasn’t been updated during theelt-run
(See this log)In the log above, the result of the replication query did not return any row while logically, it should return at least one row because the replication query is in the format:
SELECT ... FROM WHERE updated_at >= { bookmark_timestamp } - lookback-window
The hypothesis is that:
In the time replication happened, the source Team has deleted recent rows whose
updated_at >= { bookmark_timestamp } - lookback-window
That’s why the replication query return the empty result. Thus, target-redshift won’t update sdc_batched . That’s why the freshness-check failed.
Design
Add a logic in the replication process that:
Impact
With this implementation, it will ensure that in every replication at least one row would be returned if that table is empty
Caveats
None
Testing
None
Docs
None