Skip to content

NC | Add non current timestamp xattr support #8975

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

Merged
merged 1 commit into from
Apr 23, 2025

Conversation

romayalon
Copy link
Contributor

@romayalon romayalon commented Apr 20, 2025

Describe the Problem

We need a new xattr that describes when the version became non current to be assigned on uploads (move to .versions/) and removed on deletions (promote to latest). The new xattr will be used as a hint for the nc lifecycle non current days rule.

Explain the Changes

  1. assigned Date.now() to XATTR_NON_CURRENT_TIMESTASMP xattr on the following cases -
    a. _move_to_dest_version() - when moving latest version to version_path.
    b. _move_directory_content_xattr_to_versioned_file() - when moving directory object xattr to version file.
    c. _assign_versions_to_fs_xattr() - when version is a delete marker only.

  2. Removed XATTR_NON_CURRENT_TIMESTASMP value from file on _promote_version_to_latest().

  3. Updated test_bucketspace_versioning.js tests to test these cases as well.

Issues: Fixed #xxx / Gap #xxx

  1. Gap - we should catch error on clear if ENODATA in general (not only for this change) - see comment https://github.com/noobaa/noobaa-core/pull/8964/files#r2051772675

Testing Instructions:

  1. sudo NC_CORETEST=true node ./node_modules/mocha/bin/mocha src/test/unit_tests/test_bucketspace_versioning.js
  • Doc added/updated
  • Tests added

Copy link
Contributor

@nadavMiz nadavMiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nadavMiz
Copy link
Contributor

I don't think there is a problem, but we should add concurrency tests just to be safe

@romayalon romayalon force-pushed the romy-non-current-timestamp branch from fb36b2e to a0df317 Compare April 23, 2025 13:00
@romayalon romayalon merged commit 6db9733 into noobaa:master Apr 23, 2025
11 of 12 checks passed
@romayalon romayalon mentioned this pull request May 15, 2025
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.

2 participants