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

Backport to 2.10.x: #5410: Fix file trailer handling in the copy fetcher #5423

Merged
merged 1 commit into from
Mar 9, 2023

Conversation

timescale-automation
Copy link

This is an automated backport of #5410: Fix file trailer handling in the copy fetcher.
The original issue is #5323.
This PR will be merged automatically after all the relevant CI checks pass. If this fix should not be backported, or will be backported manually, just close this PR. You can use the backport branch to add your changes, it won't be modified automatically anymore.

For more details, please see the documentation

Original description

Fix file trailer handling in the copy fetcher

The copy fetcher fetches tuples in batches. When the last element in the batch is the file trailer, the trailer was not handled correctly. The existing logic did not perform a PQgetCopyData in that case. Therefore the state of the fetcher was not set to EOF and the copy operation was not correctly finished at this point.

Fixes: #5323, #5394

The copy fetcher fetches tuples in batches. When the last element in the
batch is the file trailer, the trailer was not handled correctly. The
existing logic did not perform a PQgetCopyData in that case. Therefore
the state of the fetcher was not set to EOF and the copy operation was
not correctly finished at this point.

Fixes: #5323
(cherry picked from commit 7b8177a)
@codecov
Copy link

codecov bot commented Mar 9, 2023

Codecov Report

❗ No coverage uploaded for pull request base (2.10.x@9282770). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             2.10.x    #5423   +/-   ##
=========================================
  Coverage          ?   90.67%           
=========================================
  Files             ?      226           
  Lines             ?    51994           
  Branches          ?        0           
=========================================
  Hits              ?    47147           
  Misses            ?     4847           
  Partials          ?        0           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@timescale-automation timescale-automation merged commit c394c72 into 2.10.x Mar 9, 2023
@timescale-automation timescale-automation deleted the backport/2.10.x/5410 branch March 9, 2023 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is-auto-backport PR created by backport automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants