Skip to content

Commit 655be72

Browse files
committed
NSFS | GPFS | fix put object over null version in suspended mode
Signed-off-by: nadav mizrahi <[email protected]>
1 parent 3c8a29a commit 655be72

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/sdk/namespace_fs.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,23 +1419,26 @@ class NamespaceFS {
14191419
const versioned_path = latest_ver_info && this._get_version_path(key, latest_ver_info.version_id_str);
14201420
const versioned_info = latest_ver_info && await this._get_version_info(fs_context, versioned_path);
14211421

1422-
gpfs_options = is_gpfs ?
1423-
await this._open_files_gpfs(fs_context, new_ver_tmp_path, latest_ver_path, upload_file,
1424-
latest_ver_info, open_mode, undefined, versioned_info) :
1425-
undefined;
14261422
const bucket_tmp_dir_path = this.get_bucket_tmpdir_full_path();
1427-
dbg.log1('Namespace_fs._move_to_dest_version:', latest_ver_info, new_ver_info, gpfs_options);
1428-
14291423
if (this._is_versioning_suspended()) {
14301424
if (latest_ver_info?.version_id_str === NULL_VERSION_ID) {
14311425
dbg.log1('NamespaceFS._move_to_dest_version suspended: version ID of the latest version is null - the file will be unlinked');
1426+
const delete_gpfs_options = is_gpfs ?
1427+
await this._open_files_gpfs(fs_context, latest_ver_path, undefined, undefined, undefined, undefined, true) :
1428+
undefined;
14321429
await native_fs_utils.safe_unlink(fs_context, latest_ver_path, latest_ver_info,
1433-
gpfs_options?.delete_version, bucket_tmp_dir_path);
1430+
delete_gpfs_options?.delete_version, bucket_tmp_dir_path);
14341431
} else {
14351432
// remove a version (or delete marker) with null version ID from .versions/ (if exists)
14361433
await this._delete_null_version_from_versions_directory(key, fs_context);
14371434
}
14381435
}
1436+
gpfs_options = is_gpfs ?
1437+
await this._open_files_gpfs(fs_context, new_ver_tmp_path, latest_ver_path, upload_file,
1438+
latest_ver_info, open_mode, undefined, versioned_info) :
1439+
undefined;
1440+
dbg.log1('Namespace_fs._move_to_dest_version:', latest_ver_info, new_ver_info, gpfs_options);
1441+
14391442
if (latest_ver_info &&
14401443
((this._is_versioning_enabled()) ||
14411444
(this._is_versioning_suspended() && latest_ver_info.version_id_str !== NULL_VERSION_ID))) {

0 commit comments

Comments
 (0)