-
Notifications
You must be signed in to change notification settings - Fork 72
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
Split >5GB Files automatically #21
Conversation
We cannot guarantee that a single partition will always be under Swift's 5GB size limit. When a single partition reaches the 5GB size limit, this patch will partition the file itself by opening a new stream and write the rest of the contents in another object named "FileName/part-xxxx-split-xxxx-attempt..." @gilv Can you review this? |
@djalova Sure, i will check it. Thanks. Interesting idea to split files this way. |
@djalova The correct way, in my opinion would be to perform (at the creation of Stocator instance) a query to get the Swift cluster capabilities (http://developer.openstack.org/api-ref-objectstorage-v1.html#infoDiscoverability) and thus knowing the maximum size allowed per object. @gilv What do you think? |
@Nosfe @djalova I agree, but i think we should make it configurable via configuration. |
@gilv @djalova
In this way the possibility of errors due to miss configuration is almost absent. What do you think? |
@djalova I think it's very good patch :) much better then my original idea by using SLO and manifest. |
@gilv Have you had time to test this out yet? I think I'm done with the changes I want to add. Let me know if you think there needs to be more done to get this merged. Thanks. |
@djalova It looks good. I just need to perform couple of additional tests and had no time so far. Will try to do it during the next week. |
} | ||
|
||
@Override | ||
public void close() throws IOException { | ||
LOG.info("{} bytes written", totalBytesWritten); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djalova I guess we don't want it at info level, otherwise it will be printed all the time. Can you remove it please? I recently try to reduce number of debug prints. If you like, you can make it at trace level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that makes sense.
@djalova It looks good, i just saw the code and left one comment. I will later also try to run the code. Can you please add some unitest to it or a functional test? It's not mandatory, but would be good to have. |
@djalova Can you please rebase this branch, it seems it has conflicts with master branch |
cd05a0d
to
21f43b9
Compare
@gilv I rebased and added your suggestion. I'll work on the test and push when it's done. |
@djalova I think it's very good, but we need to resolve the resiliency issues that this patch adds. As example, assume SF311.csv/part-00000-attempt_201604171048_0000_m_000000_0 is written. If the task is failed there will be new additional(s) attempts, like The list() method will pick up the correct part-0000, based on the size ( the large size is the winner ). For example it may choose SF311.csv/part-00000-attempt_201604171048_0000_m_000000_2 and ignore attempt 0 and 3. The resolution uses the fact that it's the same object name "part-0000" Adding this patch will affect the way list works, since you modify part-ID to part-ID-split SF311.csv/part-00000-attempt_201604171048_0000_m_000000_0 and there will be replacement task "1" SF311.csv/part-00000-attempt_201604171048_0000_m_000000_1 then the current code will fail to identify correct attempt, since part-0000 is modified to part-0000-split-number. I think to resolve this we just need to modify list method, so it will pick up "part-NUMBER" and not "part-NUMBER-SPLIT" |
@gilv Are you referring to the String returned by nameWithoutTaskID()? I added some debug messages and it includes the "split-xxxxx" without adding any extra code. |
@djalova i think this is exact issue here - the name should not contain "split".. |
@djalova The algorithm in list() method should be adapted as i wrote in my previous remark. Otherwise it will not work. I can try to adapt it. |
@gilv Is this so that if any of the split uploads fails, we should start over and look for a part-00000 with a different a attempt number? I assumed that since the listing is alphabetical this wouldn't be a problem. For example if we had 2 attempts, A & B it would be listed: |
@gilv I don't think there's an issue with the list because when it checks for collisions the split number is included. Also since we go through the list alphabetically, when we check for collisions it compares objects of the same part and split number when there is a failed attempt. |
@djalova Spit logic is internal, and the Spark's task is not aware of it. Here is an example the list algorithm will not work in this case. |
@gilv The naming scheme is part-#-split-#-attempt#. In the list logic, everything after the last '-' is stripped so when the objects are compared we compare part-#-split#. Do we want to make sure that we grab parts and splits from the same attempt? Or do we just care about the part and split number? |
Hello @djalova : when is this fix planned to get merged? |
Hi @khanderao |
@khanderao do you have a use case when a single Spark task write more then 4GB of data? |
Developer's Certificate of Origin 1.1