Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Skip caching redirect uri on array create #5224

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

ypatia
Copy link
Member

@ypatia ypatia commented Aug 1, 2024

Currently we store a cache of the region redirection for all requests to the REST server in redirect_uri_map. However, when an array is first created, we don't know the region yet and we sent the request to the default region, so we shouldn't be caching this. After the array has been created, subsequent requests will be redirected by the server to the right region, and only then the rest client in Core should start caching in redirect_uri_map.

[sc-50254]


TYPE: IMPROVEMENT
DESC: Skip caching redirect uri on array create

@teo-tsirpanis
Copy link
Member

Could the REST server return a header with the new array's region, in order to avoid hitting the global endpoint a second time?

@ypatia
Copy link
Member Author

ypatia commented Aug 2, 2024

Could the REST server return a header with the new array's region, in order to avoid hitting the global endpoint a second time?

I thought that's what's happening in fact. There's a "location" header where we read some URI from, I am trying to understand what the REST Server puts in there so that I can answer to you and so that I can decide if this fix is actually not needed. I'll let you know when I have the answers.

@ypatia
Copy link
Member Author

ypatia commented Aug 5, 2024

Could the REST server return a header with the new array's region, in order to avoid hitting the global endpoint a second time?

I thought that's what's happening in fact. There's a "location" header where we read some URI from, I am trying to understand what the REST Server puts in there so that I can answer to you and so that I can decide if this fix is actually not needed. I'll let you know when I have the answers.

@teo-tsirpanis To clarify, the requests hit a redirect server before the REST server which sends a Temporary Redirect message to the client with a Location header, and that's where we get the region from and store it in the cache. It's just that upon array creation the redirect server doesn't know the region yet, so it sends back the default. We shouldn't be caching that one, but ones of subsequent requests. That's what's being fixed here.

@ypatia ypatia merged commit aef8f9b into dev Aug 5, 2024
63 checks passed
@ypatia ypatia deleted the yt/sc-50254/no_redirect_cache_on_create branch August 5, 2024 12:32
@teo-tsirpanis
Copy link
Member

I see, thanks. In the future we could make the create array REST API return status code 201 with the region-specific endpoint in the Location header, and cache that one.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants