Skip to content

Commit 2fdead0

Browse files
committed
NSFS | Improve list objects performance on top of NS FS
Signed-off-by: naveenpaul1 <napaul@redhat.com>
1 parent 0f73166 commit 2fdead0

File tree

10 files changed

+773
-303
lines changed

10 files changed

+773
-303
lines changed

config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,9 @@ config.NSFS_GLACIER_MIGRATE_INTERVAL = 15 * 60 * 1000;
799799
// of `manage_nsfs glacier restore`
800800
config.NSFS_GLACIER_RESTORE_INTERVAL = 15 * 60 * 1000;
801801

802+
// enable/disable unsorted listing application level
803+
config.NSFS_LIST_OBJECTS_V2_UNSORTED_ENABLED = false;
804+
802805
// NSFS_GLACIER_EXPIRY_RUN_TIME must be of the format hh:mm which specifies
803806
// when NooBaa should allow running glacier expiry process
804807
// NOTE: This will also be in the same timezone as specified in

src/api/object_api.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,9 @@ module.exports = {
720720
limit: {
721721
type: 'integer'
722722
},
723+
list_type: {
724+
type: 'string',
725+
},
723726
}
724727
},
725728
reply: {
@@ -774,6 +777,9 @@ module.exports = {
774777
limit: {
775778
type: 'integer'
776779
},
780+
list_type: {
781+
type: 'string',
782+
},
777783
}
778784
},
779785
reply: {

src/endpoint/s3/ops/s3_get_bucket.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ async function get_bucket(req) {
4141
bucket: req.params.bucket,
4242
prefix: req.query.prefix,
4343
delimiter: req.query.delimiter,
44+
list_type: list_type,
4445
limit: Math.min(max_keys_received, 1000),
4546
key_marker: list_type === '2' ?
4647
(cont_tok_to_key_marker(cont_tok) || start_after) : req.query.marker,

src/native/fs/fs_napi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2042,7 +2042,7 @@ struct TellDir : public FSWrapWorker<DirWrap>
20422042
}
20432043
virtual void OnOK()
20442044
{
2045-
DBG0("FS::Telldir::OnOK: " << DVAL(_wrap->_path) << DVAL(_tell_res));
2045+
DBG1("FS::Telldir::OnOK: " << DVAL(_wrap->_path) << DVAL(_tell_res));
20462046
Napi::Env env = Env();
20472047
auto res = Napi::BigInt::New(env, _tell_res);
20482048
_deferred.Resolve(res);

src/sdk/namespace_fs.js

Lines changed: 198 additions & 81 deletions
Large diffs are not rendered by default.

src/test/system_tests/test_utils.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,26 @@ function get_new_buckets_path_by_test_env(new_buckets_full_path, new_buckets_dir
432432
return is_nc_coretest ? path.join(new_buckets_full_path, new_buckets_dir) : new_buckets_dir;
433433
}
434434

435+
436+
/**
437+
* common dummy SDK for testing
438+
*/
439+
function make_dummy_object_sdk() {
440+
return {
441+
requesting_account: {
442+
force_md5_etag: false,
443+
nsfs_account_config: {
444+
uid: process.getuid(),
445+
gid: process.getgid(),
446+
}
447+
},
448+
abort_controller: new AbortController(),
449+
throw_if_aborted() {
450+
if (this.abort_controller.signal.aborted) throw new Error('request aborted signal');
451+
}
452+
};
453+
}
454+
435455
/**
436456
* write_manual_config_file writes config file directly to the file system without using config FS
437457
* used for creating backward compatibility tests, invalid config files etc
@@ -532,4 +552,5 @@ exports.get_new_buckets_path_by_test_env = get_new_buckets_path_by_test_env;
532552
exports.write_manual_config_file = write_manual_config_file;
533553
exports.write_manual_old_account_config_file = write_manual_old_account_config_file;
534554
exports.delete_manual_config_file = delete_manual_config_file;
555+
exports.make_dummy_object_sdk = make_dummy_object_sdk;
535556

src/test/unit_tests/jest_tests/test_list_object.test.js

Lines changed: 0 additions & 175 deletions
This file was deleted.

0 commit comments

Comments
 (0)