Skip to content

Commit 2c43a85

Browse files
committed
NSFS | Improve list objects performance on top of NS FS (PR 2/3)
1 parent e24e59a commit 2c43a85

File tree

10 files changed

+769
-302
lines changed

10 files changed

+769
-302
lines changed

config.js

+3
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,9 @@ config.NSFS_GLACIER_MIGRATE_INTERVAL = 15 * 60 * 1000;
798798
// of `manage_nsfs glacier restore`
799799
config.NSFS_GLACIER_RESTORE_INTERVAL = 15 * 60 * 1000;
800800

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

src/api/object_api.js

+6
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

+1
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

+1-1
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

+198-80
Large diffs are not rendered by default.

src/test/system_tests/test_utils.js

+17
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,22 @@ 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+
function make_dummy_object_sdk() {
436+
return {
437+
requesting_account: {
438+
force_md5_etag: false,
439+
nsfs_account_config: {
440+
uid: process.getuid(),
441+
gid: process.getgid(),
442+
}
443+
},
444+
abort_controller: new AbortController(),
445+
throw_if_aborted() {
446+
if (this.abort_controller.signal.aborted) throw new Error('request aborted signal');
447+
}
448+
};
449+
}
450+
435451
/**
436452
* write_manual_config_file writes config file directly to the file system without using config FS
437453
* used for creating backward compatibility tests, invalid config files etc
@@ -525,6 +541,7 @@ exports.delete_fs_user_by_platform = delete_fs_user_by_platform;
525541
exports.set_path_permissions_and_owner = set_path_permissions_and_owner;
526542
exports.set_nc_config_dir_in_config = set_nc_config_dir_in_config;
527543
exports.generate_anon_s3_client = generate_anon_s3_client;
544+
exports.make_dummy_object_sdk = make_dummy_object_sdk;
528545
exports.TMP_PATH = TMP_PATH;
529546
exports.is_nc_coretest = is_nc_coretest;
530547
exports.generate_nsfs_account = generate_nsfs_account;

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

-175
This file was deleted.

0 commit comments

Comments
 (0)