Skip to content

Commit

Permalink
Optionally set mtime in linkPhysicalAddress (#8338)
Browse files Browse the repository at this point in the history
* Add optional `mtime' to linkPhysicalAddress

- Ignored by old servers
  - Tested: when a new client sends mtime to an old server, the old server
	ignores it.
- Sets object mtime
  - This is like stageObject, so (almost) already available

* Use optional `mtime' in linkPhysicalAddress
  • Loading branch information
arielshaqed authored Nov 5, 2024
1 parent bf98183 commit 5128ee9
Show file tree
Hide file tree
Showing 19 changed files with 114 additions and 3 deletions.
4 changes: 4 additions & 0 deletions api/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,10 @@ components:
content_type:
type: string
description: Object media type
mtime:
type: integer
format: int64
description: Unix Epoch in seconds. May be ignored by server.
force:
type: boolean
default: false
Expand Down
5 changes: 5 additions & 0 deletions clients/java-legacy/api/openapi.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/java-legacy/docs/StagingMetadata.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions clients/java/api/openapi.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/java/docs/StagingMetadata.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/python-legacy/docs/StagingApi.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/python-legacy/docs/StagingMetadata.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions clients/python-legacy/lakefs_client/model/staging_metadata.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/python/docs/StagingMetadata.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion clients/python/lakefs_sdk/models/staging_metadata.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/python/test/test_staging_metadata.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/rust/docs/StagingMetadata.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions clients/rust/src/models/staging_metadata.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions docs/assets/js/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,10 @@ components:
content_type:
type: string
description: Object media type
mtime:
type: integer
format: int64
description: Unix Epoch in seconds. May be ignored by server.
force:
type: boolean
default: false
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,9 @@ func (c *Controller) LinkPhysicalAddress(w http.ResponseWriter, r *http.Request,
}

writeTime := time.Now()
if mtime := body.Mtime; mtime != nil {
writeTime = time.Unix(*mtime, 0)
}
fullPhysicalAddress := swag.StringValue(body.Staging.PhysicalAddress)
physicalAddress, addressType := normalizePhysicalAddress(repo.StorageNamespace, fullPhysicalAddress)

Expand Down

0 comments on commit 5128ee9

Please sign in to comment.