Skip to content

Commit

Permalink
NC | upload_multipart should not check ctime
Browse files Browse the repository at this point in the history
Signed-off-by: Romy <35330373+romayalon@users.noreply.github.com>
  • Loading branch information
romayalon committed May 7, 2024
1 parent 49748bd commit 490755a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sdk/namespace_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,8 @@ class NamespaceFS {
const part_upload = file_path === upload_path;
const same_inode = params.copy_source && copy_res === copy_status_enum.SAME_INODE;
const is_dir_content = this._is_directory_content(file_path, params.key);
let stat = await target_file.stat(fs_context);
// upload_part should disable ctime_check because we update the same part-file on concurrent put part
let stat = await target_file.stat({ ...fs_context, disable_ctime_check: part_upload });
this._verify_encryption(params.encryption, this._get_encryption_info(stat));

// handle xattr
Expand Down Expand Up @@ -1309,7 +1310,7 @@ class NamespaceFS {
if (params.copy_source) fs_xattr = await this._get_copy_source_xattr(params, fs_context, fs_xattr);
await this._assign_dir_content_to_xattr(fs_context, fs_xattr, { ...params, size: stat.size }, copy_xattr);
}
stat = await nb_native().fs.stat(fs_context, file_path);
stat = await nb_native().fs.stat({ ...fs_context, disable_ctime_check: part_upload }, file_path);
const upload_info = this._get_upload_info(stat, fs_xattr && fs_xattr[XATTR_VERSION_ID]);
return upload_info;
}
Expand Down

0 comments on commit 490755a

Please sign in to comment.