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

Track file trailer only in debug builds #5422

Merged
merged 1 commit into from Mar 10, 2023

Conversation

jnidzwetzki
Copy link
Contributor

@jnidzwetzki jnidzwetzki commented Mar 9, 2023

The commit 96574a7 changes the handling of the file_trailer_received flag. It
is now only used in asserts and not in any other kind of logic. This
patch encapsulates the file_trailer_received in a USE_ASSERT_CHECKING
macro.

Disable-check: force-changelog-changed

@codecov
Copy link

codecov bot commented Mar 9, 2023

Codecov Report

Merging #5422 (1f0f3db) into main (7b8177a) will decrease coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #5422      +/-   ##
==========================================
- Coverage   90.68%   90.67%   -0.02%     
==========================================
  Files         227      227              
  Lines       52618    52613       -5     
==========================================
- Hits        47719    47709      -10     
- Misses       4899     4904       +5     
Impacted Files Coverage Δ
tsl/src/remote/copy_fetcher.c 85.57% <ø> (ø)

... and 7 files with indirect coverage changes

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

@jnidzwetzki jnidzwetzki force-pushed the file_trailer_assert branch 2 times, most recently from bfa8fea to 21a86a9 Compare March 9, 2023 14:36
@jnidzwetzki jnidzwetzki marked this pull request as ready for review March 9, 2023 14:37
@@ -449,7 +454,9 @@ copy_fetcher_complete(CopyFetcher *fetcher)
* nor the expected number of columns. This provides an extra
* check against somehow getting out of sync with the data.
*/
#ifdef USE_ASSERT_CHECKING
fetcher->file_trailer_received = true;
Copy link
Member

Choose a reason for hiding this comment

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

Below you have a comment saying that the loop will not be executed in some cases, so maybe we can not execute it always?

The reasons we needed this flag is that the final iteration of the loop was supposed to check for EOF. Now that you are doing this check in place, we don't need the final iteration at all, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is correct. The final loop should check for EOF but it was not always executed. Now, we perform the read operation directly here and update the EOF state accordingly. I updated the comment to make this easier to understand.

The commit 96574a7 changes the handling of the file_trailer_received
flag. It is now only used in asserts and not in any other kind of logic.
This patch encapsulates the file_trailer_received in a
USE_ASSERT_CHECKING macro.
@jnidzwetzki jnidzwetzki enabled auto-merge (rebase) March 10, 2023 09:15
@jnidzwetzki jnidzwetzki merged commit f5db023 into timescale:main Mar 10, 2023
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.

None yet

4 participants