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

Fix numNodes in CopyNode #2161

Merged
merged 1 commit into from
Oct 9, 2023
Merged

Fix numNodes in CopyNode #2161

merged 1 commit into from
Oct 9, 2023

Conversation

ray6080
Copy link
Contributor

@ray6080 ray6080 commented Oct 6, 2023

There was a change (https://github.com/kuzudb/kuzu/pull/2070/files#r1348216726) to fix edge case for copying empty csv file, which doesn't fully fix the problem with numNodes.

@codecov
Copy link

codecov bot commented Oct 6, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (4aa1d07) 89.65% compared to head (c6116f1) 89.62%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2161      +/-   ##
==========================================
- Coverage   89.65%   89.62%   -0.04%     
==========================================
  Files         989      989              
  Lines       35740    35740              
==========================================
- Hits        32042    32031      -11     
- Misses       3698     3709      +11     
Files Coverage Δ
src/processor/operator/persistent/copy_node.cpp 95.91% <100.00%> (ø)

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Riolku
Copy link
Contributor

Riolku commented Oct 6, 2023

Curious, what problems does the current code give rise to?

@ray6080
Copy link
Contributor Author

ray6080 commented Oct 7, 2023

Curious, what problems does the current code give rise to?

The case is that when sharedState->sharedNodeGroup is null, we would set numNodes to 0, which can be incorrect. sharedState->sharedNodeGroup is used only when threads have tuples left to write out. So it could be that each thread writes out all their tuples, while we still set numNodes to 0. Does this make sense?

@Riolku
Copy link
Contributor

Riolku commented Oct 7, 2023

Uh, is NodeGroup a fixed number of nodes stored together on disk? And so if all threads happen to write out a number of nodes that is a multiple of that number we get a totally incorrect statistic?

@ray6080
Copy link
Contributor Author

ray6080 commented Oct 8, 2023

Uh, is NodeGroup a fixed number of nodes stored together on disk? And so if all threads happen to write out a number of nodes that is a multiple of that number we get a totally incorrect statistic?

Yep.

@ray6080 ray6080 requested a review from Riolku October 8, 2023 01:35
@ray6080 ray6080 merged commit 5c89dc5 into master Oct 9, 2023
11 checks passed
@ray6080 ray6080 deleted the fix-copy-num branch October 9, 2023 12:52
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

3 participants