Skip to content

Skip caching redirect uri on array create#5224

Merged
ypatia merged 1 commit intodevfrom
yt/sc-50254/no_redirect_cache_on_create
Aug 5, 2024
Merged

Skip caching redirect uri on array create#5224
ypatia merged 1 commit intodevfrom
yt/sc-50254/no_redirect_cache_on_create

Conversation

@ypatia
Copy link
Copy Markdown
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

@ypatia ypatia requested review from Shelnutt2 and shaunrd0 August 1, 2024 07:53
@teo-tsirpanis
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@ypatia ypatia deleted the yt/sc-50254/no_redirect_cache_on_create branch August 5, 2024 12:32
@teo-tsirpanis
Copy link
Copy Markdown
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.

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.

4 participants