-
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
NSFS | versioning | copy_object - close chunkfs read stream to prevent stream being closed after stat #8526
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -769,6 +769,16 @@ mocha.describe('bucketspace namespace_fs - versioning', function() { | |
const exist2 = await fs_utils.file_exists(version_path_nested); | ||
assert.ok(exist2); | ||
}); | ||
|
||
mocha.it('copy object version id - version matches mtime and inode', async function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we now add test_versioning_obj_suspended_copy? or it has issue with bucket cache still? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure I'll add it. its worth mentioning that this test is for suspended more, so will not fail in this case (in suspended mode version-id is always null and doesn't depend on mtime). the reason it failed is because the bucket cache issue, the bucket remained in enabled mode |
||
const key = 'copied_key5.txt'; | ||
const res = await s3_uid6.copyObject({ Bucket: bucket_name, Key: key, | ||
CopySource: `${bucket_name}/${key1}?versionId=${key1_ver1}`}); | ||
const obj_path = path.join(full_path, key); | ||
const stat = await nb_native().fs.stat(DEFAULT_FS_CONFIG, obj_path); | ||
const expcted_version = 'mtime-' + stat.mtimeNsBigint.toString(36) + '-ino-' + stat.ino.toString(36); | ||
assert.equal(expcted_version, res.VersionId); | ||
}); | ||
}); | ||
|
||
mocha.describe('copy object (latest version) - versioning suspended - nsfs copy fallback flow', function() { | ||
|
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.
why don't we need to resume() on regular upload flow?
is there a chance on upload that the readable stream will change the xattr after we assigned the version id ?
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.
because in regular upload we pipe chunkfs to the source_stream, so the readable part is used, and ends on its own. while on the copy flow we use chunkfs as write stream and ignore the read part