Skip to content
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 | MPU | Disable ctime check on load_multipart() #8158

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

romayalon
Copy link
Contributor

@romayalon romayalon commented Jun 19, 2024

Explain the changes

Background -
Checking ctime on the upload id directory does not make sense because for a directory, ctime changes when any of its attributes or contents (like adding or removing files) are modified.

For instance -

> mkdir my_dir/
> stat -s my_dir/
st_dev=16777231 st_ino=39137529 st_mode=040755 st_nlink=2 st_uid=501 st_gid=20 st_rdev=0 st_size=64 st_atime=1718816608 st_mtime=1718816608 st_ctime=1718816608 st_birthtime=1718816608 st_blksize=4096 st_blocks=0 st_flags=0
> echo "obj1 content" >  my_dir/obj1.txt
> stat -s my_dir/
st_dev=16777231 st_ino=39137529 st_mode=040755 st_nlink=3 st_uid=501 st_gid=20 st_rdev=0 st_size=96 st_atime=1718816778 st_mtime=1718816777 st_ctime=1718816777 st_birthtime=1718816608 st_blksize=4096 st_blocks=0 st_flags=0

Notice that the ctime changed after adding a file to the directory, therefore, on concurrent upload of parts we will see ctime changes of the upload id directory.

Changes -
Disabled ctime checking on the mpu_path stat.
Notice it'll affect all the calling functions to load_multipart() -

  1. upload multipart
  2. list multipart
  3. complete object upload
  4. abort object upload

Issues: Fixed #xxx / Gap #xxx

  1. Fixed observed in noobaa log as "cancelled due to ctime change" actual upload didn't fail  #7833
  2. We should go through the whole NamespaceFS file and try find these concurrency issues that might happen on every stat call.

Testing Instructions:

  1. Tab 1 - sudo node src/cmd/nsfs.js --debug=5 2&> mpu.log
  2. Tab 2 - node src/tools/s3cat --endpoint http://localhost:6001 --access_key XXX --secret_key YYY --bucket bucket1_name --upload --size $((100*1024)) --part_size 32 --concur 16
    wait for the upload to finish.
  3. Tab 1 - cat mpu.log | grep cancel
  • Doc added/updated
  • Tests added

Signed-off-by: Romy <35330373+romayalon@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

observed in noobaa log as "cancelled due to ctime change" actual upload didn't fail
2 participants