Skip to content

Do not use epoch for sorting #1163

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
May 12, 2025
Merged

Do not use epoch for sorting #1163

merged 1 commit into from
May 12, 2025

Conversation

roman-khimov
Copy link
Member

No description provided.

@roman-khimov roman-khimov requested a review from smallhive as a code owner May 8, 2025 19:47
@roman-khimov roman-khimov requested a review from Copilot May 8, 2025 19:48
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes the use of epoch-based fields for sorting and replaces them with the creation timestamp across several API layers.

  • Removed all references to CreationEpoch and its associated attributes from data structures and search filters.
  • Updated parsing, error messages, and sorting functions to rely solely on CreationTimestamp.
  • Modified tests and mocks to use a controlled current time for consistency.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
api/layer/tagging.go Removed CreationEpoch field and updated parsing and sorting to use CreationTimestamp.
api/layer/system_object.go Replaced CreationEpoch with CreationTimestamp and adjusted attribute indexes and error logs.
api/layer/object.go Updated attribute mappings and sort functions to use CreationTimestamp consistently.
api/layer/neofs_mock.go Introduced currentTime for mock objects and deliberately ignored prm.CreationTime.
api/layer/layer.go Changed container versioning logic to use CreationTimestamp over CreationEpoch.
Comments suppressed due to low confidence (3)

api/layer/neofs_mock.go:61

  • [nitpick] Consider adding a comment clarifying why prm.CreationTime is deliberately ignored in favor of t.currentTime to aid future maintainers.
t.currentTime: time.Now().Unix(),

api/layer/tagging.go:130

  • Ensure that replacing CreationEpoch with CreationTimestamp is consistently propagated; verify that downstream logic and documentation are updated to reflect this change.
psr.CreationTimestamp, err = strconv.ParseInt(item.Attributes[1], 10, 64)

api/layer/object.go:466

  • Double-check that the attribute index mapping correctly corresponds to the new CreationTimestamp field, ensuring no misalignment with the upstream attribute order.
psr.CreationTimestamp, err = strconv.ParseInt(item.Attributes[1], 10, 64)

Epoch doesn't mean much for S3 objects and lifecycle management can lead to
surpises here. Timestamp is sufficient for proper logic.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
@roman-khimov roman-khimov force-pushed the drop-creation-epoch branch from 560de58 to ebca1c4 Compare May 8, 2025 19:51
@roman-khimov roman-khimov merged commit 8be0801 into master May 12, 2025
17 of 20 checks passed
@roman-khimov roman-khimov deleted the drop-creation-epoch branch May 12, 2025 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants