-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[Test Only][SPARK-6235][CORE]Address various 2G limits #14995
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
Conversation
|
Test build #65039 has finished for PR 14995 at commit
|
|
Test build #65041 has finished for PR 14995 at commit
|
|
Test build #65069 has finished for PR 14995 at commit
|
|
Test build #65070 has finished for PR 14995 at commit
|
|
Test build #65075 has finished for PR 14995 at commit
|
|
Test build #65090 has finished for PR 14995 at commit
|
|
Test build #65098 has finished for PR 14995 at commit
|
|
retest please. |
|
Jenkins, retest this please |
|
Test build #65126 has finished for PR 14995 at commit
|
a8f89d4 to
b31fbcd
Compare
|
Test build #65247 has finished for PR 14995 at commit
|
b31fbcd to
11401ac
Compare
|
Test build #65291 has finished for PR 14995 at commit
|
|
Test build #65305 has finished for PR 14995 at commit
|
a5403fe to
57833e3
Compare
|
Test build #65584 has finished for PR 14995 at commit
|
5634dea to
58d4b7c
Compare
|
Test build #65696 has finished for PR 14995 at commit
|
|
Test build #65695 has finished for PR 14995 at commit
|
58d4b7c to
81fd814
Compare
|
Test build #65967 has finished for PR 14995 at commit
|
|
Jenkins, retest this please |
|
Test build #65968 has finished for PR 14995 at commit
|
81fd814 to
754b9dc
Compare
|
Test build #66032 has finished for PR 14995 at commit
|
754b9dc to
53d6ad6
Compare
|
Test build #66579 has finished for PR 14995 at commit
|
53d6ad6 to
043845f
Compare
043845f to
be1efc4
Compare
|
Test build #67024 has finished for PR 14995 at commit
|
be1efc4 to
540a65a
Compare
|
Test build #68069 has finished for PR 14995 at commit
|
|
What is the plan to incorporate this patch into a released version? I am hitting this limit when doing simple joins of a table with 2 million records to a table of 300 million records and performing a count. |
|
@witgo if this is a stale WIP, would you mind closing it? as far as I know it doesn't necessarily solve the problem in the JIRA and may be misleading to those that think there is a solution available. It's actually many problems in one. |
|
@srowen |
|
This change is marked as not ready to merge, does not merge, hasn't been reviewed, and isn't going to be reviewed as a huge 143-file, 4400 line change. This has been discussed in many different ways regarding this issue over time. |
|
I compiled this pull request into the main branch. I can confirm it fixes the problem where I was performing joins between tables with 2 million and 300 million records + making counts and then getting the java Integer error. Previous to building the patched version, I had tried setting 2000 partitions on the Dataframes with spark.sql.shuffle.partitions and the failure still occurred. I don't see there is a valid workaround through partitioning or that the failure occurs as a program design issue. If the patch is not merged, I will likely make a docker image that contains it and publish that through docker.io. What is the way forward to getting this into a released version? |
|
This PR is Test only, it used to
includes two underlying API changes.
There should not be much debate about 1.(Master branch has done some of the relevant changes), But @rxin has a different idea for 2. @srowen What do you think of the above two changes? |
540a65a to
04172e0
Compare
|
Test build #69116 has started for PR 14995 at commit |
|
Test FAILed. |
|
@witgo I have a Pyspark application that was failing in 3 different places but is able to run without errors now. I'm glad for this patch as I am not sure how I would have explained to my professors why the big data application I chose to do my analysis has 32 bit limitations. This is my final project for a Georgia Tech Big data class and I will write about the these limitations of Spark in my paper. My app is called the Surgeon Scorecard and it computes surgical complication rate for surgeons on the Medicare synthetic cms dataset which is about 1.6 billion records. https://github.com/opme/SurgeonScorecard. |
|
@opme Thanks, I am glad to hear this, and I want to solve the issues of reading, storing and transmitting data as much as possible. |
|
hi@witgo ,i am glad to see this patch ,but i do not know how should i check this patch,i need this very much, thank you for give me this patch url.please and thanks! |
|
@witgo hi ,i want to know this patch can be used in preduct env? |
|
I did not do much testing, but I think it can be used in the production environment |
|
@witgo i am very sorry to ask you give me a zip to my email ,because i try to get this branch more than 10 times ,but i can not download this branch ,my email is [email protected],please help me ,thanks very much! |
What changes were proposed in this pull request?
motivation
The various 2G limit in Spark.
When reading the data block is stored in the disk, the following code fragment is called.
The above code has the following problems:
channel.map(MapMode.READ_ONLY, 0, file.length)returns an instance ofMappedByteBuffer. the size ofMappedByteBuffercan not exceed 2G.Iterator[Any]is generated, need to load all the data into the memory,this may take up a lot of memory.When using kryo serialized data, the following code fragment is called:
The above code has the following problems:
outputinternalbyte[], the size ofbyte[]can not exceed 2G.When RPC writes data to be sent to the Channel, the following code fragment is called:
The above code has the following problems:
When decodes the RPC message received, the following code fragment is called:
The above code has the following problems:
Goals
Design
Setup for eliminating the various 2G limit in Spark.
Replace ByteBuffer with ChunkedByteBuffer. (The 2G limit 1,2)
Reference counted objects
InputStream,ByteBuffer,byte[]andByteBuf, etc.Move the ChunkedByteBuffer class to
common/network-common/src/main/java/org/apache/spark/network/buffer/.Modify
ManagedBuffer.nioByteBuffer's return value to ChunkedByteBuffer instance.(The 2G limit 1)Modify the parameter of
SerializerInstance.deserializeand the return value ofSerializerInstance.serializeto ChunkedByteBuffer instance. (The 2G limit 2)Other changes.
Replace ByteBuf with InputStream.
Modify
NioManagedBuffer.convertToNettymethod returns InputStream instances when data is larger than Integer.MAX_VALUE. (The 2G limit 3)Add InputStreamManagedBuffer class, used to convert InputStream instance to ManagedBuffer instance. (The 2G limit 4)
Modify MessageWithHeader classes, support processing InputStream instance (The 2G limit 3)
Modify the parameters of the
Encodable.encodemethod to OutputStream instance. (The 2G limit 4)Modify the parameters of the decode method of the classes who implement the Encodable interface to InputStream instance.It can handle mixed storage data (The 2G limit 3)
Modify TransportFrameDecoder class, use
LinkedList<ByteBuf>to represent the Frame, remove the size limit of Frame. The 2G limit 4)Add ByteBufInputStream class, used to convert
LinkedList<ByteBuf>instance to InputStream instance. (The 2G limit 4)Modify the parameters of
RpcHandler.receivemethod to InputStream instance. (The 2G limit 4)Read data
Local data
DiskStore.getBytes's return value type to ManagedBuffer instance, which callsManagedBuffer.nioByteBufferonly when the memory has enough space to store the ManagedBuffer data.Remote Data (The 2G limit 4)
There are three options:
channel.config ().SetAutoRead (false)disable AUTO_READ, no longer automatically callchannle.read ().channel.config().setAutoRead(true)enable AUTO_READ .How was this patch tested?
Each block has a 4G data, each map ' s data file has 16G of data, a total of 64G data.
=>