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

postgres: return unknown records instead of skipping them #3876

Merged
merged 1 commit into from Jan 9, 2023

Conversation

calebdoxsey
Copy link
Contributor

Summary

Instead of skipping unknown records, return them with a struct any of {"id": "ID"}.

Previously when we skipped these records we inadvertently stopped a stream early if too many unknown records were returned, because the stream.pending list would be empty, so the code would think the stream was complete when in fact there were many more records available that would be returned by subsequent SQL calls.

Related issues

Fixes https://github.com/pomerium/internal/issues/1207

Checklist

  • reference any related issues
  • updated unit tests
  • add appropriate tag (improvement / bug / etc)
  • ready for review

@calebdoxsey calebdoxsey added bug Something isn't working backport 0-20-0 labels Jan 9, 2023
@calebdoxsey calebdoxsey requested a review from a team as a code owner January 9, 2023 21:55
@coveralls
Copy link

Coverage Status

Coverage: 62.889% (+0.03%) from 62.862% when pulling 4b22880 on cdoxsey/unknown-record-type into 9677e18 on main.

@calebdoxsey calebdoxsey merged commit 92b5068 into main Jan 9, 2023
@calebdoxsey calebdoxsey deleted the cdoxsey/unknown-record-type branch January 9, 2023 22:10
@backport-actions-token
Copy link

The backport to 0-20-0 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-0-20-0 0-20-0
# Navigate to the new working tree
cd .worktrees/backport-0-20-0
# Create a new branch
git switch --create backport-3876-to-0-20-0
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 92b50683ff34210a6cb6dff5c0e203f74ae1d5d4
# Push it to GitHub
git push --set-upstream origin backport-3876-to-0-20-0
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-0-20-0

Then, create a pull request where the base branch is 0-20-0 and the compare/head branch is backport-3876-to-0-20-0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 0-20-0 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants