Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

update_physical_path_for_decoupled_naming() is unnecessarily executed twice when there is no redirect #2162

Open
1 task
JustinKyleJames opened this issue Jan 9, 2024 · 3 comments

Comments

@JustinKyleJames
Copy link
Contributor

JustinKyleJames commented Jan 9, 2024

  • main

In the redirect scenario, update_physical_path_for_decoupled_naming must be called from two different locations.

  1. From s3_notify which is run on the server the client is connected to. This ensures that the decoupled name get written properly to the database.
  2. From s3_file_create which is run on the server we are redirected to. This ensures that object is written to the correct S3 key.

In the non-redirect case, the above two code paths still both call update_physical_path_for_decoupled_naming. This means that the code will iterate through the L1desc[] table twice (usually only one or two iterations as the entries are almost always in the first couple of slots) and update the physical_path twice. This is slightly inefficient.

We should detect that this has already been executed on that server and not execute it a second time.

@trel
Copy link
Member

trel commented Jan 10, 2024

nice.

so we save a value somewhere in step 1, and when in step 2, we should detect/check that value and skip going to the database.

@JustinKyleJames
Copy link
Contributor Author

nice.

so we save a value somewhere in step 1, and when in step 2, we should detect/check that value and skip going to the database.

Well, in the non-redirect case we will never go to the database because the L1desc[] table is available.

@trel
Copy link
Member

trel commented Jan 10, 2024

right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants