-
Notifications
You must be signed in to change notification settings - Fork 10
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-18879: Clear offset when max_skip
error is encountered and return 0 if skip
is greater than 250k in the current state.
#29
base: master
Are you sure you want to change the base?
Conversation
tap_closeio/streams.py
Outdated
if not date_window: | ||
LOGGER.warning("Invalid value of date window is passed: \'{}\', using default window size of 15 days.".format(ctx.config.get("date_window"))) | ||
date_window = 15 | ||
LOGGER.warning("Invalid value of date window is passed: \'{}\', using default window size of 5 days.".format(ctx.config.get("date_window"))) |
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.
LOGGER.warning("Invalid value of date window is passed: \'{}\', using default window size of 5 days.".format(ctx.config.get("date_window"))) | |
LOGGER.warning("Invalid value of date window is passed: \'{}\', using default window size of {} days.".format(ctx.config.get("date_window")),DATE_WINDOW_SIZE) |
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
tap_closeio/streams.py
Outdated
except ValueError: | ||
LOGGER.warning("Invalid value of date window is passed: \'{}\', using default window size of 15 days.".format(ctx.config.get("date_window"))) | ||
LOGGER.warning("Invalid value of date window is passed: \'{}\', using default window size of 5 days.".format(ctx.config.get("date_window"))) |
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.
LOGGER.warning("Invalid value of date window is passed: \'{}\', using default window size of 5 days.".format(ctx.config.get("date_window"))) | |
LOGGER.warning("Invalid value of date window is passed: \'{}\', using default window size of {} days.".format(ctx.config.get("date_window")), DATE_WINDOW_SIZE) |
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
tap_closeio/streams.py
Outdated
date_window = int(ctx.config.get("date_window", 15)) | ||
# if date_window is 0, '0' or None, then set default window size of 15 days | ||
date_window = int(ctx.config.get("date_window", DATE_WINDOW_SIZE)) | ||
# if date_window is 0, '0' or None, then set default window size of 5 days |
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.
# if date_window is 0, '0' or None, then set default window size of 5 days | |
# if date_window is 0, '0' or None, then set the default window size to DATE_WINDOW_SIZE(5 days) |
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.
Updated
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.
After reading the card this PR is written to address, I don't think this is the approach we should take to debug this issue for the customer
max_skip
error is encountered and return 0 if skip
is greater than 250k in the current state.
tap_closeio/context.py
Outdated
@@ -46,7 +46,10 @@ def set_bookmark(self, path, val): | |||
|
|||
def get_offset(self, path): | |||
off = bks_.get_offset(self.state, path[0]) | |||
return (off or {}).get(path[1]) | |||
value = (off or {}).get(path[1]) | |||
if path[0] == "activities" and value > 250000: |
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.
Add a comment here regarding a specific scenario like when the state reached this condition for the customer with the previous version and this will reduce skip to 0 for date_windowing and all.
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 comment
tap_closeio/streams.py
Outdated
ctx.write_state() | ||
if 'max_skip = ' in str(e): | ||
if tap_stream_id == IDS.ACTIVITIES: | ||
LOGGER.warning("The skip cannot be greater than 250000, please reduce the date window size and try again.") |
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.
LOGGER.warning("The skip cannot be greater than 250000, please reduce the date window size and try again.") | |
LOGGER.warning("Hit max_skip error so clearing skip offset, please reduce the date window size and try again.") |
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.
Updated
tap_closeio/streams.py
Outdated
# clear offset | ||
ctx.clear_offsets(tap_stream_id) | ||
ctx.write_state() | ||
raise |
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.
Need to add the message to reduce the date window.
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.
Updated error message
ctx.write_state() | ||
if 'max_skip = ' in str(e): | ||
if tap_stream_id == IDS.ACTIVITIES: | ||
LOGGER.warning("Hit max_skip error so clearing skip offset, please reduce the date window size and try again.") |
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.
It should be an error and must be raised with this message.
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
Description of change
TDL-18879: Clear offset when max_skip error is encountered and return 0 if skip is greater than 250k in the current state.
max_skip
error.Manual QA steps
Risks
Rollback steps