Skip to content
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

Wait for at least one record or PKM before returning even after timeout #669

Closed
wants to merge 10 commits into from

Conversation

iskakaushik
Copy link
Contributor

@iskakaushik iskakaushik commented Nov 16, 2023

Earlier the flow was on connection timeout we would return the currently accumulated records. Now the continue and resetting the standby deadline, means that we will continue waiting for newer records in case we don't have any records or PKMs.

The reason we exit at all from PullRecords is to checkpoint. We store metadata on the destination corresponding to committed LSN and we do it in batches because data warehouses operate better that way. Without records there's no need to checkpoint and we can wait indefinitely.

fixes: #670

return val
}

func IsTestEnv() bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is generally pretty dangerous unless used carefully. Since it means you aren't testing when !IsTestEnv & that's the case that matters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

100% agreed - filed: #672 and will follow-up with fixing the tests. The urgency in landing the PR is for a ongoing issue.

@iskakaushik iskakaushik force-pushed the wait-for-at-least-one branch 9 times, most recently from de1d8c5 to c6f0f1e Compare November 20, 2023 13:20
@iskakaushik iskakaushik force-pushed the wait-for-at-least-one branch from c6f0f1e to 8274773 Compare November 21, 2023 18:41
@iskakaushik iskakaushik closed this Dec 1, 2023
@serprex serprex deleted the wait-for-at-least-one branch February 15, 2024 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[cdc] Wait for at least one record or PKM (primary keep alive message)
2 participants