Compare commits

...

1 Commits

Author SHA1 Message Date
williamlardier 9fb6e0ee53
wip 2023-05-24 00:28:31 +02:00
7 changed files with 19 additions and 17 deletions

BIN
cldsrv-10.gzip Normal file

Binary file not shown.

View File

@ -13,12 +13,11 @@ const { maximumMetaHeadersSize,
function checkUserMetadataSize(responseMetadata) {
let userMetadataSize = 0;
// collect the user metadata keys from the object metadata
const userMetadataHeaders = Object.keys(responseMetadata)
.filter(key => key.startsWith('x-amz-meta-'));
// compute the size of all user metadata key and its value
userMetadataHeaders.forEach(header => {
userMetadataSize += header.length + responseMetadata[header].length;
});
for (let key in responseMetadata) {
if (responseMetadata.hasOwnProperty(key) && key.startsWith('x-amz-meta-')) {
userMetadataSize += key.length + responseMetadata[key].length;
}
}
// check the size computed against the maximum allowed
// if the computed size is greater, then remove all the
// user metadata from the response object

View File

@ -197,7 +197,7 @@ function getObjMetadataAndDelete(authInfo, canonicalID, request,
// doing 5 requests at a time. note that the data wrapper
// will do 5 parallel requests to data backend to delete parts
return async.forEachLimit(inPlay, 5, (entry, moveOn) => {
return async.forEachLimit(inPlay, Number(process.env.OPTIM_WORKERS) || 25, (entry, moveOn) => {
async.waterfall([
callback => {
let decodedVersionId;
@ -351,6 +351,7 @@ function getObjMetadataAndDelete(authInfo, canonicalID, request,
// end of forEach func
err => {
log.trace('finished deleting objects', { numOfObjectsRemoved });
console.log('end of multi delete object');
return next(err, quietSetting, errorResults, numOfObjectsRemoved,
successfullyDeleted, totalContentLengthDeleted, bucket);
});

View File

@ -305,17 +305,16 @@ function objectGet(authInfo, request, returnTagCount, log, callback) {
'GET', bucketName, err.code, 'getObject');
return callback(err);
}
const contentLength = Number.parseInt(responseMetaHeaders['Content-Length'], 10);
pushMetric('getObject', log, {
authInfo,
bucket: bucketName,
keys: [objectKey],
newByteLength:
Number.parseInt(responseMetaHeaders['Content-Length'], 10),
newByteLength: contentLength,
versionId: objMD.versionId,
location: objMD.dataStoreName,
});
monitoring.promMetrics('GET', bucketName, '200', 'getObject',
Number.parseInt(responseMetaHeaders['Content-Length'], 10));
monitoring.promMetrics('GET', bucketName, '200', 'getObject', contentLength);
return callback(null, dataLocator, responseMetaHeaders,
byteRange);
});

View File

@ -18,8 +18,11 @@ function collectResponseHeaders(objectMD, corsHeaders, versioningCfg,
returnTagCount) {
// Add user meta headers from objectMD
let responseMetaHeaders = Object.assign({}, corsHeaders);
Object.keys(objectMD).filter(val => (val.startsWith('x-amz-meta-')))
.forEach(id => { responseMetaHeaders[id] = objectMD[id]; });
for (let key in objectMD) {
if (objectMD.hasOwnProperty(key) && key.startsWith('x-amz-meta-')) {
responseMetaHeaders[key] = objectMD[key];
}
}
// Check user metadata size
responseMetaHeaders = checkUserMetadataSize(responseMetaHeaders);

View File

@ -21,7 +21,7 @@
"dependencies": {
"@azure/storage-blob": "^12.12.0",
"@hapi/joi": "^17.1.0",
"arsenal": "git+https://github.com/scality/arsenal#8.1.98",
"arsenal": "git+https://github.com/scality/arsenal#8e259f97ef97d82be00493a36a92a25866e18613",
"async": "~2.5.0",
"aws-sdk": "2.905.0",
"bucketclient": "scality/bucketclient#8.1.9",

View File

@ -716,9 +716,9 @@ arraybuffer.slice@~0.0.7:
optionalDependencies:
ioctl "^2.0.2"
"arsenal@git+https://github.com/scality/arsenal#8.1.98":
version "8.1.97"
resolved "git+https://github.com/scality/arsenal#3f7229eebe378a0f4852d2c25b9ac33c027fa7eb"
"arsenal@git+https://github.com/scality/arsenal#8e259f97ef97d82be00493a36a92a25866e18613":
version "8.1.96"
resolved "git+https://github.com/scality/arsenal#8e259f97ef97d82be00493a36a92a25866e18613"
dependencies:
"@azure/identity" "^3.1.1"
"@azure/storage-blob" "^12.12.0"