Skip to content
This repository was archived by the owner on Feb 13, 2026. It is now read-only.

api/complete-multipart: fixes and tests.#2719

Merged
harshavardhana merged 2 commits intominio:masterfrom
hackintoshrao:complete-mul-fix
Sep 22, 2016
Merged

api/complete-multipart: fixes and tests.#2719
harshavardhana merged 2 commits intominio:masterfrom
hackintoshrao:complete-mul-fix

Conversation

@hackintoshrao
Copy link
Copy Markdown
Contributor

@hackintoshrao hackintoshrao commented Sep 16, 2016

With detailed discussion with @krishnasrinivas , we found out this approach to be the simplest amongst the other alternatives.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Sep 16, 2016

Current coverage is 65.67% (diff: 100%)

Merging #2719 into master will increase coverage by 0.22%

@@             master      #2719   diff @@
==========================================
  Files           132        132          
  Lines         15289      15265    -24   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          10007      10025    +18   
+ Misses         4567       4529    -38   
+ Partials        715        711     -4   

Powered by Codecov. Last update 559ad38...22da31b

Copy link
Copy Markdown
Contributor

@krishnasrinivas krishnasrinivas left a comment

Choose a reason for hiding this comment

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

@hackintoshrao @harshavardhana the complication for completemultipart upload is arising because we have to accomodate the sendwhitespace() function. sendwhitespace() is not useful for XL, it was written because of slow concat process of FS. But since we now do append in background as parts come, FS's completemultipart() is also quick now. That means we can just remove sendwhitespace() functionality and avoid all complications.

Downside is we will not send whitespace chars for the slow concat fall back in FS. But it's a compromise we can make to keep code simple. Because anyhow we saw cloudberry timeout even if we sent white space chars. So for well behaved client uploads we work just fine.

@harshavardhana
Copy link
Copy Markdown
Member

harshavardhana commented Sep 17, 2016

@hackintoshrao @harshavardhana the complication for completemultipart upload is arising because we have to accomodate the sendwhitespace() function. sendwhitespace() is not useful for XL, it was written because of slow concat process of FS. But since we now do append in background as parts come, FS's completemultipart() is also quick now. That means we can just remove sendwhitespace() functionality and avoid all complications.

Downside is we will not send whitespace chars for the slow concat fall back in FS. But it's a compromise we can make to keep code simple. Because anyhow we saw cloudberry timeout even if we sent white space chars. So for well behaved client uploads we work just fine.

I agree that is what i was leaning towards, we are okay to not do that since sending whitespace character is a S3 spec and as we have seen with experience by now the doc SPEC is not the direct representation of their implementation.

Let's remove the go-routine at the top and we can avoid all the complications that came with it.

import "net/http"

// Represents additional fields necessary for ErrPartTooSmall S3 error.
type completeMultipartAPIError struct {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do not introduce these custom errors just yet, i am fixing this differently. For now do not validate other fields other than the common ones that occur in APIErrorResponse

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK, for now I'll make changes to send usual error response.

doneCh <- struct{}{}
}(doneCh)

sendWhiteSpaceChars(w, doneCh)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's remove this and we will solve all the problems and we will not need to change the function signature of CompleteMultipartUpload

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So I'll keep the CompleteMultipart API signature as it was and remove the sending of white space characters and running complete multipart in a new routine.

@hackintoshrao hackintoshrao force-pushed the complete-mul-fix branch 7 times, most recently from db7f7c3 to e71adf8 Compare September 21, 2016 22:06
Karthic Rao added 2 commits September 22, 2016 07:17
- Removing the logic of sending white space characters.
- Fix for incorrect HTTP response status for certain cases.
- Tests for New Multipart Upload and Complete Multipart Upload.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants