-
Notifications
You must be signed in to change notification settings - Fork 78
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
NSFS | NC | Handle Concurrency When Reading Entries and They Deleted by Another Process #8183
Conversation
0f6db95
to
e25c234
Compare
…by another process 1. fix concurrency issue on delete account (when a bucket was deleted during deletion) 2. fix concurrency issue on list buckets (when a bucket was deleted during deletion) 3. fix concurrency issue on s3 api list buckets (when a bucket was deleted during deletion) 4. add TODO in accountspace_fs 5. add test (not related to the issue, was added during debug) Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
957a1d9
to
c42e64d
Compare
Additional Testing Notes:The code part you will add after reading the directory and getting the entries is sleep, for example: console.log('SDSD entries', entries);
await set_sleep(30000); async function set_sleep(ms) {
console.log('SDSD sleep', ms);
await sleep(ms);
}
function sleep(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
} Open a terminal tab for each process:
|
Explain the changes
accountspace_fs
.Issues: Fixed #7920
accountspace_fs
list (IAM ListUsers API) should also be fixed.Testing Instructions:
Manual Tests:
FS_ROOT
and a directory for a bucket:mkdir -p /tmp/nsfs_root1/my-bucket
and give permissionschmod 777 /tmp/nsfs_root1/
chmod 777 /tmp/nsfs_root1/my-bucket
.This will be the argument for:
new_buckets_path
flag/tmp/nsfs_root1
(that we will use in the account commands)path
in the buckets commands/tmp/nsfs_root1/my-bucket
(that we will use in bucket commands).sudo node src/cmd/manage_nsfs account add --name <account-name> --uid <uid> --gid <gid> --new_buckets_path <new_buckets_path>
sudo node src/cmd/manage_nsfs bucket add --name <bucket-name> --owner <account-name> --path <path>
(use the--owner
from the previous account add command, for example: bucket-1, bucket-2, bucket-3).For example - when deleting an account we check if the account has buckets (hence we list them):
5. (process 1 - open a tab in the terminal) Delete account:
sudo node src/cmd/manage_nsfs account delete --name <account-name> --debug 5
(we use the debug flag to see printing related to the filesystem, we expect to see on the deleted config file an error message "No such file or directory")6. (process 2 - open a tab in the terminal) Delete bucket (bucket-2 for example):
sudo node src/cmd/manage_nsfs bucket delete --name <bucket-name>