Skip to content

Commit 77fc48b

Browse files
committed
NSFS | Improve list objects performance on top of NS FS
Signed-off-by: naveenpaul1 <[email protected]>
1 parent b171929 commit 77fc48b

File tree

10 files changed

+807
-306
lines changed

10 files changed

+807
-306
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
@@ -2061,7 +2061,7 @@ struct TellDir : public FSWrapWorker<DirWrap>
20612061
}
20622062
virtual void OnOK()
20632063
{
2064-
DBG0("FS::Telldir::OnOK: " << DVAL(_wrap->_path) << DVAL(_tell_res));
2064+
DBG1("FS::Telldir::OnOK: " << DVAL(_wrap->_path) << DVAL(_tell_res));
20652065
Napi::Env env = Env();
20662066
auto res = Napi::BigInt::New(env, _tell_res);
20672067
_deferred.Resolve(res);

src/sdk/namespace_fs.js

Lines changed: 232 additions & 84 deletions
Large diffs are not rendered by default.

src/test/system_tests/test_utils.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,26 @@ function get_new_buckets_path_by_test_env(new_buckets_full_path, new_buckets_dir
474474
return is_nc_coretest ? path.join(new_buckets_full_path, new_buckets_dir) : new_buckets_dir;
475475
}
476476

477+
478+
/**
479+
* common dummy SDK for testing
480+
*/
481+
function make_dummy_object_sdk() {
482+
return {
483+
requesting_account: {
484+
force_md5_etag: false,
485+
nsfs_account_config: {
486+
uid: process.getuid(),
487+
gid: process.getgid(),
488+
}
489+
},
490+
abort_controller: new AbortController(),
491+
throw_if_aborted() {
492+
if (this.abort_controller.signal.aborted) throw new Error('request aborted signal');
493+
}
494+
};
495+
}
496+
477497
/**
478498
* write_manual_config_file writes config file directly to the file system without using config FS
479499
* used for creating backward compatibility tests, invalid config files etc
@@ -627,8 +647,10 @@ exports.get_new_buckets_path_by_test_env = get_new_buckets_path_by_test_env;
627647
exports.write_manual_config_file = write_manual_config_file;
628648
exports.write_manual_old_account_config_file = write_manual_old_account_config_file;
629649
exports.delete_manual_config_file = delete_manual_config_file;
650+
exports.make_dummy_object_sdk = make_dummy_object_sdk;
630651
exports.create_redirect_file = create_redirect_file;
631652
exports.delete_redirect_file = delete_redirect_file;
632653
exports.fail_test_if_default_config_dir_exists = fail_test_if_default_config_dir_exists;
633654
exports.create_config_dir = create_config_dir;
634655
exports.clean_config_dir = clean_config_dir;
656+

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)