You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix overflow of pageNumber in VeloxSortShuffleWriter.
In our testing of sort shuffle, we found that when the page number exceeded 8191, the compactRowId became corrupted, which caused a crash during data writing. This PR fixes this issue.
C [libgluten.so+0x254a63d] LZ4_read_ARCH+0xc
C [libgluten.so+0x257df2e] LZ4_compress_fast_continue+0x101d9
C [libgluten.so+0x2530f27] LZ4F_compressBlock_continue+0x5b
C [libgluten.so+0x2530d5f] LZ4F_makeBlock+0x65
C [libgluten.so+0x25313b7] LZ4F_compressUpdateImpl+0x2f7
C [libgluten.so+0x25315ec] LZ4F_compressUpdate+0x4c
C [libgluten.so+0x20fb4f3] arrow::util::internal::(anonymous namespace)::LZ4Compressor::Compress(long, unsigned char const*, long, unsigned char*)+0x1eb
C [libgluten.so+0x17c7c35] gluten::ShuffleCompressedOutputStream::Write(void const*, long)+0x15f
C [libgluten.so+0x17e4c18] gluten::InMemoryPayload::serialize(arrow::io::OutputStream*)+0xaa
C [libgluten.so+0x17c989c] gluten::LocalPartitionWriter::LocalSpiller::spill(unsigned int, std::unique_ptr<gluten::InMemoryPayload, std::default_delete<gluten::InMemoryPayload> >)+0x18c
C [libgluten.so+0x17c67ef] gluten::LocalPartitionWriter::sortEvict(unsigned int, std::unique_ptr<gluten::InMemoryPayload, std::default_delete<gluten::InMemoryPayload> >, bool)+0x41b
C [libvelox.so+0x81a94ec] gluten::VeloxSortShuffleWriter::evictPartitionInternal(unsigned int, unsigned char*, long)+0x1e8
C [libvelox.so+0x81a909e] gluten::VeloxSortShuffleWriter::evictPartition(unsigned int, unsigned long, unsigned long)+0x3f4
C [libvelox.so+0x81a8970] gluten::VeloxSortShuffleWriter::evictAllPartitions()+0x2e2
C [libvelox.so+0x81a6b7a] gluten::VeloxSortShuffleWriter::stop()+0x74
C [libgluten.so+0x1795fd1] Java_org_apache_gluten_vectorized_ShuffleWriterJniWrapper_stop+0x12d
Thank for the fix. Can you add a comment to header file and comment
pageNumber_ 13bit pageCursor_ 27bit row2Partition_ vector of 24bit
Done.
We ran into an issue where the number of pages exceeded 8,192. From the code, the maximum memory per page is 64 MB, which is a hard-coded limit, so it shouldn’t exceed the 128 MB cap here. The number of partitions theoretically shouldn’t exceed 16 million. Therefore, this change didn’t add additional checks, although having similar checks would indeed be beneficial.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes are proposed in this pull request?
Fix overflow of pageNumber in VeloxSortShuffleWriter.
In our testing of sort shuffle, we found that when the page number exceeded 8191, the compactRowId became corrupted, which caused a crash during data writing. This PR fixes this issue.
How was this patch tested?