Skip to content

Commit

Permalink
Merge pull request #1108 from noobaa/eran_04x_fixes
Browse files Browse the repository at this point in the history
S3 fixes
  • Loading branch information
tamireran committed Apr 28, 2016
2 parents ad4ff7e + 5771615 commit 47869a8
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1 class="heading2">Noobaa Storage Solution</h1>
<h1 class="heading2">NooBaa Storage Solution</h1>

<p class="container">
Current Version:
Current Version:
<output class="text-tech emphasized" data-bind="value: version"></output>
</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { loadBucketList, createAccount } from 'actions';

function makeUserMessage(loginInfo, S3AccessInfo) {
return `
<p class="paragraph">Hi, I created a noobaa user for you:</p>
<p class="paragraph">Hi, I created a NooBaa user for you:</p>
${makeLoginMessage(loginInfo)}<br>
${S3AccessInfo ? makeS3AccessMessage(S3AccessInfo) : ''}
`;
Expand Down Expand Up @@ -42,7 +42,7 @@ class CreateAccountWizardViewModel {
this.detailsStepTemplate = detailsStepTemplate;

this.emailAddress = ko.observable()
.extend({
.extend({
required: { message: 'Please enter an email address' },
email: { message: 'Please enter a valid email address' },
notIn: {
Expand Down Expand Up @@ -91,7 +91,7 @@ class CreateAccountWizardViewModel {

validateStep(step) {
switch (step) {
case 1:
case 1:
if (this.nameAndPermissionsErrors().length > 0) {
this.nameAndPermissionsErrors.showAllMessages();
return false;
Expand Down Expand Up @@ -119,9 +119,9 @@ class CreateAccountWizardViewModel {

create() {
createAccount(
systemInfo().name,
this.emailAddress(),
this.password,
systemInfo().name,
this.emailAddress(),
this.password,
this.accessKeys,
this.enableS3Access() ? this.selectedBuckets() : undefined
);
Expand All @@ -139,4 +139,4 @@ class CreateAccountWizardViewModel {
export default {
viewModel: CreateAccountWizardViewModel,
template: template
};
};
15 changes: 12 additions & 3 deletions src/api/object_io.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,17 @@ class ObjectIO {
.return(md5_digest);
}, err => {
dbg.log0('upload_stream: error write stream', params.key, err);
throw err;
return params.client.object.delete_object(_.pick(params,
'bucket',
'key'))
.then(() => {
dbg.log0('removed partial object', params.key, 'from bucket', params.bucket);
throw err;
})
.fail(() => {
throw err;
});

});
}

Expand Down Expand Up @@ -286,8 +296,7 @@ class ObjectIO {
return pipeline.run()
.then(() => {
var sha256_promise = '';
if(params.calculate_sha256)
{
if (params.calculate_sha256) {
sha256_promise = P.resolve(sha256_stream && sha256_stream.wait_digest());
}
return P.all([P.resolve(md5_stream && md5_stream.wait_digest()), sha256_promise])
Expand Down
5 changes: 1 addition & 4 deletions src/s3/s3_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,7 @@ class S3Controller {
* http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html
*/
delete_object(req) {
return req.rpc_client.object.delete_object({
bucket: req.params.bucket,
key: req.params.key
});
return req.rpc_client.object.delete_object(this._object_path(req));
}


Expand Down
5 changes: 2 additions & 3 deletions src/server/node_monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ function update_heartbeat(req, reply_token) {
])
.spread(function(node_arg, storage_used) {
node = node_arg;
dbg.log0('ETET:storage_used', storage_used);
if (!node) {
// we don't fail here because failures would keep retrying
// to find this node, and the node is not in the db.
Expand Down Expand Up @@ -475,7 +474,7 @@ function collect_agent_diagnostics(req) {
}

function set_debug_node(req) {
var target = req.rpc_params.target;
var target = req.rpc_params.target;
return P.fcall(function() {
return server_rpc.client.agent.set_debug_node({
level: req.rpc_params.level
Expand Down Expand Up @@ -545,4 +544,4 @@ function _resync_agents() {
throw new Error('Failed resyncing agents to redirector');
});
});
}
}
4 changes: 4 additions & 0 deletions src/server/object_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ function complete_object_upload(req) {
dbg.log0('aggregated_md5', obj_etag);
return map_writer.fix_multipart_parts(obj);
});
}else
{
dbg.log0('complete_object_upload no fix for',obj);
return obj.size;
}
})
.then(object_size => {
Expand Down

0 comments on commit 47869a8

Please sign in to comment.