Compare commits
6 Commits
developmen
...
feature/AR
Author | SHA1 | Date |
---|---|---|
Nicolas Humbert | 4c3098c13e | |
Ronnie Smith | 7f29e03e4a | |
Ronnie Smith | 3c6742b607 | |
Ronnie Smith | 1f1fd401c1 | |
Ronnie Smith | dab7f54dc5 | |
Ronnie Smith | d6fcbdb4f6 |
|
@ -74,6 +74,9 @@ module.exports = {
|
|||
},
|
||||
/* eslint-disable camelcase */
|
||||
externalBackends: { aws_s3: true, azure: true, gcp: true, pfs: true },
|
||||
hasCopyPartBackends: { aws_s3: true, gcp: true },
|
||||
versioningNotImplBackends: { azure: true, gcp: true },
|
||||
mpuMDStoredExternallyBackend: { aws_s3: true, gcp: true },
|
||||
/* eslint-enable camelcase */
|
||||
// Default expiration value of the S3 pre-signed URL duration
|
||||
// 604800 seconds (seven days).
|
||||
|
|
|
@ -40,7 +40,9 @@ module.exports.reconstructError = function reconstructError(err) {
|
|||
return err;
|
||||
}
|
||||
const reconstructedErr = new Error(err.message);
|
||||
|
||||
reconstructedErr.is = {
|
||||
[err.message]: true,
|
||||
};
|
||||
Object.keys(err).forEach(k => {
|
||||
reconstructedErr[k] = err[k];
|
||||
});
|
||||
|
|
|
@ -146,7 +146,7 @@ class DataWrapper {
|
|||
return;
|
||||
}
|
||||
this._retryDelete(clientGetInfo, log, 0, err => {
|
||||
if (err && !err.ObjNotFound) {
|
||||
if (err && !err.is.ObjNotFound) {
|
||||
log.error('delete error from datastore',
|
||||
{ error: err, key: objectGetInfo.key, moreRetries: 'no' });
|
||||
}
|
||||
|
@ -984,7 +984,7 @@ class DataWrapper {
|
|||
return this.client.delete(objectGetInfo, log.getSerializedUids(),
|
||||
err => {
|
||||
if (err) {
|
||||
if (err.ObjNotFound) {
|
||||
if (err.is.ObjNotFound) {
|
||||
log.info('no such key in datastore', {
|
||||
objectGetInfo,
|
||||
implName: this.implName,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
const cluster = require('cluster');
|
||||
const async = require('async');
|
||||
|
||||
const errors = require('../../../errors').default;
|
||||
|
@ -20,7 +19,6 @@ class BucketFileInterface {
|
|||
/**
|
||||
* @constructor
|
||||
* @param {object} [params] - constructor params
|
||||
* @param {boolean} [params.noDbOpen=false] - true to skip DB open
|
||||
* @param {object} logger - logger
|
||||
* (for unit tests only)
|
||||
*/
|
||||
|
@ -29,9 +27,6 @@ class BucketFileInterface {
|
|||
const { host, port } = params.metadataClient;
|
||||
this.constants = params.constants;
|
||||
this.mdClient = new MetadataFileClient({ host, port });
|
||||
if (params && params.noDbOpen) {
|
||||
return;
|
||||
}
|
||||
this.lastItemScanTime = null;
|
||||
this.lastItemScanResult = null;
|
||||
}
|
||||
|
@ -44,16 +39,17 @@ class BucketFileInterface {
|
|||
// the metastore sublevel is used to store bucket attributes
|
||||
this.mdDB = value;
|
||||
this.metastore = this.mdDB.openSub(METASTORE);
|
||||
if (cluster.isMaster) {
|
||||
this.setupMetadataServer(done);
|
||||
}
|
||||
this.setupMetadataServer(done);
|
||||
});
|
||||
}
|
||||
|
||||
setupMetadataServer(done) {
|
||||
/* Since the bucket creation API is expecting the
|
||||
usersBucket to have attributes, we pre-create the
|
||||
usersBucket attributes here */
|
||||
usersBucket attributes here.
|
||||
This call is idempotent so we are ok calling it many times
|
||||
when using multiple workers.
|
||||
*/
|
||||
this.mdClient.logger.debug('setting up metadata server');
|
||||
const usersBucketAttr = new BucketInfo(this.constants.usersBucket,
|
||||
'admin', 'admin', new Date().toJSON(),
|
||||
|
@ -95,7 +91,7 @@ class BucketFileInterface {
|
|||
|
||||
createBucket(bucketName, bucketMD, log, cb) {
|
||||
this.getBucketAttributes(bucketName, log, err => {
|
||||
if (err && err !== errors.NoSuchBucket) {
|
||||
if (err && !err.is.NoSuchBucket) {
|
||||
return cb(err);
|
||||
}
|
||||
if (err === undefined) {
|
||||
|
@ -114,7 +110,7 @@ class BucketFileInterface {
|
|||
.withRequestLogger(log)
|
||||
.get(bucketName, {}, (err, data) => {
|
||||
if (err) {
|
||||
if (err.ObjNotFound) {
|
||||
if (err.is.ObjNotFound) {
|
||||
return cb(errors.NoSuchBucket);
|
||||
}
|
||||
const logObj = {
|
||||
|
@ -138,7 +134,7 @@ class BucketFileInterface {
|
|||
db.withRequestLogger(log)
|
||||
.get(objName, params, (err, objAttr) => {
|
||||
if (err) {
|
||||
if (err.ObjNotFound) {
|
||||
if (err.is.ObjNotFound) {
|
||||
return cb(null, {
|
||||
bucket: bucketAttr.serialize(),
|
||||
});
|
||||
|
@ -232,7 +228,7 @@ class BucketFileInterface {
|
|||
}
|
||||
db.withRequestLogger(log).get(objName, params, (err, data) => {
|
||||
if (err) {
|
||||
if (err.ObjNotFound) {
|
||||
if (err.is.ObjNotFound) {
|
||||
return cb(errors.NoSuchKey);
|
||||
}
|
||||
const logObj = {
|
||||
|
|
Loading…
Reference in New Issue