Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Verify link address expiration set to 24h#10180

Open
nopcoder wants to merge 2 commits intomasterfrom
remove/link-address-expiration
Open

Verify link address expiration set to 24h#10180
nopcoder wants to merge 2 commits intomasterfrom
remove/link-address-expiration

Conversation

@nopcoder
Copy link
Contributor

@nopcoder nopcoder commented Feb 24, 2026

  • Update the link verification time from 6h to 24h.
  • Same for GC client default set to 24h.

Close #10099

@nopcoder nopcoder self-assigned this Feb 24, 2026
@github-actions github-actions bot added area/cataloger Improvements or additions to the cataloger area/testing Improvements or additions to tests labels Feb 24, 2026
@nopcoder nopcoder added include-changelog PR description should be included in next release changelog mostly-ai labels Feb 24, 2026
@nopcoder nopcoder requested a review from N-o-Z February 24, 2026 19:56
@nopcoder nopcoder marked this pull request as ready for review February 24, 2026 19:56
@arielshaqed
Copy link
Contributor

I understand why this change. But ideally we would recall why we had this in the first place, and what the cost of removing it will be.
IIUC once we remove this any older link can just be GCed away. We should document that.

@N-o-Z
Copy link
Member

N-o-Z commented Feb 24, 2026

I understand why this change. But ideally we would recall why we had this in the first place, and what the cost of removing it will be. IIUC once we remove this any older link can just be GCed away. We should document that.

The implications are - physical addresses that are uploaded and not linked within the 6 hour grace period are in danger of being removed by the GC process.

@nopcoder I have a proposal for mitigation - since a big part of the risk here is to link a non-existing object, can we add a check that there's actually an object at the physical location before linking it?
This could substantially reduce the risk here

@nopcoder
Copy link
Contributor Author

@N-o-Z I think that checking the object during link will prevent the use of the API while working with minimal permission - as far as I know the user can link data while the client have the permissions to upload the data while lakeFS doesn't have permission to read.
And there is also the fact that it will make the API much slower if we perform a call to the object store at this point.

@arielshaqed document the openapi spec like we did for copy object?

@N-o-Z
Copy link
Member

N-o-Z commented Feb 25, 2026

@N-o-Z I think that checking the object during link will prevent the use of the API while working with minimal permission - as far as I know the user can link data while the client have the permissions to upload the data while lakeFS doesn't have permission to read. And there is also the fact that it will make the API much slower if we perform a call to the object store at this point.

@arielshaqed document the openapi spec like we did for copy object?

In this case I think we need to discuss this change further

@nopcoder nopcoder changed the title Remove link address expiration check from VerifyLinkAddress Make link address expiration configurable Feb 26, 2026
@github-actions github-actions bot added docs Improvements or additions to documentation and removed area/testing Improvements or additions to tests labels Feb 26, 2026
@github-actions
Copy link

github-actions bot commented Feb 26, 2026

📚 Documentation preview at https://pr-10180.docs-lakefs-preview.io/

(Updated: 2/27/2026, 8:06:01 AM - Commit: 6383a03)

@nopcoder
Copy link
Contributor Author

@N-o-Z made it configurable and update the description with the findings.

Copy link
Member

@N-o-Z N-o-Z left a comment

Choose a reason for hiding this comment

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

Thanks!

Can we add this to the lakeFS config please (maybe in capabilities)?
This solution is not complete until we use this configuration in the GC client

@itaiad200
Copy link
Contributor

Can you add the reasoning for making it configurable? I thought we wanted to remove it completely

@nopcoder nopcoder force-pushed the remove/link-address-expiration branch from 81db273 to 6383a03 Compare February 27, 2026 08:05
@nopcoder
Copy link
Contributor Author

Can we add this to the lakeFS config please (maybe in capabilities)? This solution is not complete until we use this configuration in the GC client

Updated - thanks!

@nopcoder
Copy link
Contributor Author

Can you add the reasoning for making it configurable? I thought we wanted to remove it completely

Added it into the notes of the PR.

@nopcoder nopcoder requested a review from N-o-Z February 27, 2026 08:12
Copy link
Contributor

@itaiad200 itaiad200 left a comment

Choose a reason for hiding this comment

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

I think we should reduce complexity, not additional guardrails, configuration and more functionality that is not really needed. I believe the users shouldn't be aware of that, should be allowed to configure it, and we should not validate timestamps while linking.

@nopcoder
Copy link
Contributor Author

I think we should reduce complexity, not additional guardrails, configuration and more functionality that is not really needed. I believe the users shouldn't be aware of that, should be allowed to configure it, and we should not validate timestamps while linking.

The current guardrail prevents the possibility of long-running uploads being deleted. Unlike other operations, where you can run GC within a specific timeframe, uploads of large data are not easy to coordinate.

@nopcoder nopcoder requested a review from itaiad200 March 1, 2026 14:57
Copy link
Member

@N-o-Z N-o-Z left a comment

Choose a reason for hiding this comment

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

Thanks,
I'm only blocking because I think disabling the grace time altogether will be a major issue.
If it is already configurable - let the user configure it to as long as they wish.
Disabling it completely without understanding the GC implications could be disastrous.
Also, think about what will be the expected behavior for GC when the grace is 0?


writeResponse(w, r, http.StatusOK, apigen.GarbageCollectionConfig{
GracePeriod: swag.Int(int(catalog.LinkAddressTime.Seconds())),
GracePeriod: swag.Int(int(c.Catalog.LinkAddressExpiration.Seconds())),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
GracePeriod: swag.Int(int(c.Catalog.LinkAddressExpiration.Seconds())),
GarbageCollectionGracePeriod: swag.Int(int(c.Catalog.LinkAddressExpiration.Seconds())),

Or:

Suggested change
GracePeriod: swag.Int(int(c.Catalog.LinkAddressExpiration.Seconds())),
LinkAddressGracePeriod: swag.Int(int(c.Catalog.LinkAddressExpiration.Seconds())),

* `graveler.ensure_readable_root_namespace` `(bool: true)` - When creating a new repository use this to verify that lakeFS has access to the root of the underlying storage namespace. Set `false` only if lakeFS should not have access (i.e pre-sign mode only).
* `graveler.max_batch_delay` `(duration : 3ms)` - Controls the server batching period for references store operations.
* `graveler.background.rate_limit` `(int : 0)` - Requests per seconds limit on background work performed (default: 0 - unlimited), like deleting committed staging tokens.
* `graveler.link_address_expiration` `(duration : "6h")` - How long a pre-signed staging upload address remains valid. Set to `0` to disable the expiration check.
Copy link
Member

Choose a reason for hiding this comment

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

If we decided to make this configurable, I suggest having a minimal grace that makes sense (let's say 6 hours) and if a user needs more than that they can configure this to be as big as they want.
Disabling the grace altogether still creates an issue with GC

@itaiad200
Copy link
Contributor

I think we should reduce complexity, not additional guardrails, configuration and more functionality that is not really needed. I believe the users shouldn't be aware of that, should be allowed to configure it, and we should not validate timestamps while linking.

The current guardrail prevents the possibility of long-running uploads being deleted. Unlike other operations, where you can run GC within a specific timeframe, uploads of large data are not easy to coordinate.

So let's extend the grace period from 6 hours to 24 hours and be done with it. I don't see the value of making this configurable.

@nopcoder nopcoder force-pushed the remove/link-address-expiration branch from 6383a03 to c50eb05 Compare March 2, 2026 15:47
@github-actions github-actions bot removed the docs Improvements or additions to documentation label Mar 2, 2026
@nopcoder nopcoder changed the title Make link address expiration configurable Verify link address expiration set to 24h Mar 2, 2026
@nopcoder
Copy link
Contributor Author

nopcoder commented Mar 2, 2026

@itaiad200 update the code to set time verification limit to 24h.

@N-o-Z
Copy link
Member

N-o-Z commented Mar 2, 2026

I think we should reduce complexity, not additional guardrails, configuration and more functionality that is not really needed. I believe the users shouldn't be aware of that, should be allowed to configure it, and we should not validate timestamps while linking.

The current guardrail prevents the possibility of long-running uploads being deleted. Unlike other operations, where you can run GC within a specific timeframe, uploads of large data are not easy to coordinate.

So let's extend the grace period from 6 hours to 24 hours and be done with it. I don't see the value of making this configurable.

I just want to clarify the implications of this change.
This means that 24hrs is going to be the smallest resolution for the GC process.
This change must be coupled with modification of the GC client

@N-o-Z
Copy link
Member

N-o-Z commented Mar 2, 2026

I think we should reduce complexity, not additional guardrails, configuration and more functionality that is not really needed. I believe the users shouldn't be aware of that, should be allowed to configure it, and we should not validate timestamps while linking.

The current guardrail prevents the possibility of long-running uploads being deleted. Unlike other operations, where you can run GC within a specific timeframe, uploads of large data are not easy to coordinate.

So let's extend the grace period from 6 hours to 24 hours and be done with it. I don't see the value of making this configurable.

I just want to clarify the implications of this change. This means that 24hrs is going to be the smallest resolution for the GC process and the retention policy. This change must be coupled with modification of the GC client

@nopcoder nopcoder force-pushed the remove/link-address-expiration branch from c50eb05 to 5d5de83 Compare March 2, 2026 16:27
@nopcoder
Copy link
Contributor Author

nopcoder commented Mar 2, 2026

This change must be coupled with modification of the GC client

Thanks @N-o-Z updated the client code too.

@nopcoder nopcoder requested a review from N-o-Z March 2, 2026 16:28
Copy link
Contributor

@itaiad200 itaiad200 left a comment

Choose a reason for hiding this comment

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

Thanks.
I think this change is reasonable. 24 hours to complete a single file write to the storage and updating it in lakeFS should be more than enough. The only downside for extending the grace period is that objects are deleted 18 hours later - I think it's worth the reduced complexity.

I still don't understand why we need to verify long running multipart upload. Are we concerned about a multipart upload taking more than 24 hours, completed in the object store (uncompleted mpu are not gc'd) so it could be seen by the GC, but not registered in lakeFS? I find this race condition impossible, it could only occur if someone deliberately chooses not to complete mpus, and we can document the implications when GC is running.
We can do this in a separate PR though.

@github-actions github-actions bot added the area/testing Improvements or additions to tests label Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cataloger Improvements or additions to the cataloger area/client/spark area/testing Improvements or additions to tests include-changelog PR description should be included in next release changelog mostly-ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configurable Link Address TTL

4 participants