-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NC | NSFS | Add stat
to account_id_cache
#8642
Open
shirady
wants to merge
9
commits into
noobaa:master
Choose a base branch
from
shirady:nsfs-nc-account-id-cache-with-stat
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+210
−14
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nadavMiz
reviewed
Jan 5, 2025
nadavMiz
reviewed
Jan 5, 2025
shirady
force-pushed
the
nsfs-nc-account-id-cache-with-stat
branch
from
January 6, 2025 07:27
6f2284e
to
0785809
Compare
nadavMiz
reviewed
Jan 6, 2025
Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
…stat_account_config_file by access key Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
1. get_identity_by_id_and_stat_file simplify and avoid the same try-catch as stat_account_config_file_by_identity 2. stat_account_config_file_by_identity avoid the nested try-catch Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
…_by_name) Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
shirady
force-pushed
the
nsfs-nc-account-id-cache-with-stat
branch
from
January 9, 2025 10:37
d38faac
to
daaa60b
Compare
nadavMiz
approved these changes
Jan 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explain the changes
config.js
move the definition ofACCOUNTS_ID_CACHE_EXPIRY
near the the configurations ofOBJECT_SDK_BUCKET_CACHE_EXPIRY_MS
andOBJECT_SDK_ACCOUNT_CACHE_EXPIRY_MS
.accountspace_fs.js
:Number(config.ACCOUNTS_ID_CACHE_EXPIRY)
).load
inside function to beget_identity_by_id_and_stat_file
so we will have the identity with thestat
as property inside it.validate
method, and add the functions_validate_account_id
andcheck_same_stat_account
that were partially copied from object_sdk.config_fs
add the functionget_identity_by_id_and_stat_file
andstat_account_config_file_by_identity
that would try to stat the account config file (covering the identity, accounts_by_name - new path, accounts - old path).object_sdk.js
add a new line betweenanonymous_access_key
bucket_namespace_cache
for easier readability, fix a typo in a comment.Note: the changes are based on the suggesting written as a comment.
Issues:
stat
tobucket_namespace_cache
#8527 and NC | NSFS | Add stat toaccount_cache
#8585.Testing Instructions:
Automatic Test:
Please run:
sudo NC_CORETEST=true node ./node_modules/mocha/bin/mocha ./src/test/unit_tests/test_nc_with_a_couple_of_forks.js
Manual Test:
sudo node src/cmd/manage_nsfs account add --name <account-name> --new_buckets_path /Users/buckets/ --access_key <access-key> --secret_key <secret-key> --uid <uid> --gid <gid>
Note: before creating the account need to give permission to the
new_buckets_path
:chmod 777 /Users/buckets/
.dbg.log0('SDSD same_stat', same_stat);
beforeif (!same_stat) { // config file of bucket was changed
and start the NSFS server with:sudo node src/cmd/nsfs --debug 5
alias nc-user-1-s3=‘AWS_ACCESS_KEY_ID=<access-key> AWS_SECRET_ACCESS_KEY=<secret-key> aws --no-verify-ssl --endpoint-url https://localhost:6443’
.nc-user-1-s3 s3 ls; echo $?
nc-user-1-s3 s3 mb s3://bucket-01
(bucket-01
is the bucket name in this example)nc-user-1-s3 s3api head-bucket --bucket bucket-01
(expect to see "SDSD same_stat true")sudo node src/cmd/manage_nsfs account update --name <account-name> --fs_backend GPFS
(it was '' and we change it to GPFS).nc-user-1-s3 s3api head-bucket --bucket bucket-01
(expect to see "SDSD same_stat false").