Skip to content

NSFS | versioning | POSIX - safe_move validation fails if the mtime changes #8995

Open
@nadavMiz

Description

@nadavMiz

Environment info

  • NooBaa Version: VERSION
  • Platform: Kubernetes 1.14.1 | minikube 1.1.1 | OpenShift 4.1 | other: specify

on POSIX safe_move function we validate the mtime to the version-id. in case the mtime of the file was changed after it was created (and got a version-id): safe_move will fail on mismatch mtime. this will keep happening no matter how much we try to move because the version-id and mtime do no fit anymore. this may also be the case for the safe_unlink function.

see:
SafeMove, SafeUnlink in fs_nappi.cpp

Actual behavior

1.move fails with internal error

Expected behavior

1.move succeeds

Steps to reproduce

  1. enable versioning:
s3api put-bucket-versioning --bucket test-bucket --versioning-configuration Status=Enabled
  1. create a new object:
s3api put-object --bucket test-bucket --key key1
  1. change mtime of the file:
    on linux:
touch -d "5 days ago" ${target_path}

on mac:

touch -t $(date -v -5d +"%Y%m%d%H%M.%S") ${target_path}
  1. create a new object with the same key:
s3api put-object --bucket test-bucket --key key1

this will try to move the object to the .versions dir

More information - Screenshots / Logs / Other output

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions