-
Notifications
You must be signed in to change notification settings - Fork 19
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
TDL-15566: Data loss of child streams #57
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -406,7 +406,8 @@ def sync_substream(self, state, parent, sub_stream, parent_response): | |
integer_datetime_fmt= | ||
"unix-milliseconds-integer-datetime-parsing" | ||
) as transformer: | ||
stream_events = sub_stream.sync(state, new_bookmark, | ||
# syncing child streams from start date or state file date | ||
stream_events = sub_stream.sync(state, bookmark_dttm, | ||
record.get(parent.key_properties[0])) | ||
for event in stream_events: | ||
counter.increment() | ||
|
@@ -928,12 +929,10 @@ def get_params(self, start_time): | |
def sync(self, state, start_date=None, key_id=None): | ||
update_currently_syncing(state, self.name) | ||
|
||
bookmark_date = self.get_bookmark(state, self.name, | ||
self.config.get('start_date'), | ||
self.replication_key) | ||
bookmark_dttm = strptime_to_utc(bookmark_date) | ||
|
||
abs_start, abs_end = get_absolute_start_end_time(bookmark_dttm) | ||
# using "start_date" that is passed and not using the bookmark | ||
# value stored in the state file, as it will be updated after | ||
# every sync of child stream for parent stream | ||
abs_start, abs_end = get_absolute_start_end_time(start_date) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @savan-chovatiya What if I run the sync again once all the child streams and parent streams are synced? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it will start collecting from the bookmark present in the state file, here the |
||
lookback = abs_start - timedelta(days=self.lookback_window()) | ||
window_next = lookback | ||
|
||
|
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.
@savan-chovatiya Can you please add unit test cases for this code change
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.
Added unittest.