Skip to content

Optimize ReadN in CDC by collecting records in batches #284

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hariso
Copy link
Contributor

@hariso hariso commented May 6, 2025

Description

Closes #278.

Quick checks:

  • I have followed the Code Guidelines.
  • There is no other pull request for the same update/change.
  • I have written unit tests.
  • I have made sure that the PR is of reasonable size and can be easily reviewed.

@hariso hariso changed the title [WIP] Optimize ReadN Optimize ReadN in CDC by collecting records in batches May 13, 2025
Comment on lines -583 to -588
records, err := i.NextN(ctx, 5)
if err != nil {
is.True(strings.Contains(err.Error(), "logical replication error"))
} else {
is.True(len(records) > 0)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I read this part of the test, I wasn't sure what the expected behavior was (i.e., whether we expected an error or not). Based on the test description ("subscription termination"), it appeared to me that an error is what we should always expect.

@hariso hariso marked this pull request as ready for review May 14, 2025 15:20
@hariso hariso requested a review from a team as a code owner May 14, 2025 15:20
@hariso hariso force-pushed the haris/read-n-batches branch from d288eee to c181d90 Compare May 14, 2025 15:22
@hariso hariso enabled auto-merge (squash) May 15, 2025 12:06
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.

Feature: Add support for collecting records in batches
1 participant