-
Notifications
You must be signed in to change notification settings - Fork 360
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
Fix: Copy object mtime #8291
Fix: Copy object mtime #8291
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 |
---|---|---|
|
@@ -2715,7 +2715,6 @@ func (c *Catalog) CopyEntry(ctx context.Context, srcRepository, srcRef, srcPath, | |
|
||
// copy data to a new physical address | ||
dstEntry := *srcEntry | ||
dstEntry.CreationDate = time.Now() | ||
dstEntry.Path = destPath | ||
dstEntry.AddressType = AddressTypeRelative | ||
dstEntry.PhysicalAddress = c.PathProvider.NewPath() | ||
|
@@ -2741,6 +2740,11 @@ func (c *Catalog) CopyEntry(ctx context.Context, srcRepository, srcRef, srcPath, | |
return nil, err | ||
} | ||
|
||
// Update creation date only after actual copy!!! | ||
// The actual file upload can take a while and depend on many factors so we would like | ||
// The mtime (creationDate) in lakeFS to be as close as possible to the mtime in the underlying storage | ||
dstEntry.CreationDate = time.Now() | ||
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. I wonder - shouldn't we use the blockstore's mtime instead of 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. Out of scope for this fix. Your suggestion is a valid question which has implications that we are currently evaluating since it requires another call to the underlying storage |
||
|
||
// create entry for the final copy | ||
err = c.CreateEntry(ctx, destRepository, destBranch, dstEntry, opts...) | ||
if err != nil { | ||
|
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.
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.
This comment is incorrect, it does not prevent any discrepancy
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.
Huh, this is kind of what I understood from reading the issue description. Maybe "prevent" isn't accurate, as this fix aims to minimise the time difference rather than making it equal, but maybe I got it all wrong 😄
In any case, my point is to add a why to this comment, not only what.