[#335] Improve determining AccessBox latest version #391
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-s3-gw#391
Loading…
Reference in a new issue
No description provided.
Delete branch "Anoke/frostfs-s3-gw:improve-determing-latest-version-accessbox"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As it was asked used S3-CRDT-Versions-Add header to know if one version is older than other, for this I modified function less to sort objectVersion correctly
@ -108,6 +108,12 @@ func (v *ObjectVersions) getAddHeader() string {
}
func less(ov1, ov2 *ObjectVersion) bool {
if contains(splitVersions(ov1.Headers[versionsAddAttr]), ov2.VersionID()) {
It seems we can use just
@ -111,2 +115,4 @@
return true
}
if ov1.CreationEpoch == ov2.CreationEpoch {
return ov1.VersionID() < ov2.VersionID()
On this line we will compute VersionIDs, that have already been computed above (line 111, 114). So probably we can compute this just one in the beginning of the function:
81b3b213d2
tob98a43e059
@Anoke please check linter error. You can run it locally with
make lint
or see output of CI/CD runner: https://git.frostfs.info/TrueCloudLab/frostfs-s3-gw/actions/runs/2643/jobs/0373b8552bd
toeb13da1565
AccessBox
latest version #335