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

bugfix: fix shared buffer in v4 raw forward index writer #12587

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

itschrispeck
Copy link
Collaborator

@itschrispeck itschrispeck commented Mar 7, 2024

Scanning column data for columns using rawIndexWriterVersion=4 caused intermittent buffer position exceptions and decompression exceptions. When investigating this I noticed chunks from one partition were saved in the segment for another partition. This was caused by using a buffer constructed with a relative path:

    _dataBuffer = new File(file.getName() + DATA_BUFFER_SUFFIX);

Tests are updated to cover concurrent writing (multiple writers, sequential per writer), and also adds tests for MV functionality

tags: bugfix

@itschrispeck itschrispeck changed the title bugfix: fix shared chunk buffer in v4 raw forward index writer bugfix: fix shared buffer in v4 raw forward index writer Mar 7, 2024
@codecov-commenter
Copy link

codecov-commenter commented Mar 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.78%. Comparing base (59551e4) to head (8295fe1).
Report is 79 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #12587      +/-   ##
============================================
+ Coverage     61.75%   61.78%   +0.03%     
- Complexity      207      211       +4     
============================================
  Files          2436     2451      +15     
  Lines        133233   133730     +497     
  Branches      20636    20704      +68     
============================================
+ Hits          82274    82629     +355     
- Misses        44911    44984      +73     
- Partials       6048     6117      +69     
Flag Coverage Δ
custom-integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration <0.01% <0.00%> (-0.01%) ⬇️
integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration2 0.00% <0.00%> (ø)
java-11 61.70% <100.00%> (-0.01%) ⬇️
java-21 61.65% <100.00%> (+0.02%) ⬆️
skip-bytebuffers-false 61.74% <100.00%> (-0.01%) ⬇️
skip-bytebuffers-true 61.61% <100.00%> (+33.88%) ⬆️
temurin 61.78% <100.00%> (+0.03%) ⬆️
unittests 61.78% <100.00%> (+0.03%) ⬆️
unittests1 46.93% <0.00%> (+0.04%) ⬆️
unittests2 27.71% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

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

Good catch!

@@ -94,7 +94,7 @@ public class VarByteChunkForwardIndexWriterV4 implements VarByteChunkWriter {

public VarByteChunkForwardIndexWriterV4(File file, ChunkCompressionType compressionType, int chunkSize)
throws IOException {
_dataBuffer = new File(file.getName() + DATA_BUFFER_SUFFIX);
_dataBuffer = new File(file.getParentFile(), file.getName() + DATA_BUFFER_SUFFIX);
Copy link
Contributor

Choose a reason for hiding this comment

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

We might also want to check its existence, and delete it if exists

Copy link
Member

@richardstartin richardstartin left a comment

Choose a reason for hiding this comment

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

Good catch!

@Jackie-Jiang Jackie-Jiang merged commit 7a79e1e into apache:master Mar 7, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants