Fix for opt-in AWS S3 regions when no explicit region is specified#88930
Fix for opt-in AWS S3 regions when no explicit region is specified#88930alexey-milovidov merged 3 commits intoClickHouse:masterfrom
Conversation
|
Workflow [PR], commit [96aa021] Summary: ❌
|
19cd84c to
96aa021
Compare
|
@zvonand, please, rotate the accidental credentials leak. I removed the version with it, but I think you still need to revoke it. |
Already did, seconds after doing it. |
|
|
@antonio2368 hi! Could you please review this PR as well? |
| } | ||
|
|
||
| /// special handling for opt-in regions | ||
| if (new_region_detected && is_illegal_constraint_exception && initial_endpoint.substr(11) == "amazonaws.com") |
There was a problem hiding this comment.
can you help me understand why we cannot rely on the logic below?
It should be same as what you did here.
There was a problem hiding this comment.
Maybe we can't use getURIFromError but we can only modify that code:
auto new_uri = is_illegal_constraint_exception ? initial_endpoint : getURIFromError(error);Would something like this work?
There was a problem hiding this comment.
yes, it actually would. shall I submit a small PR to make this look a bit better then?
There was a problem hiding this comment.
Yes if you don't mind.
The code is already a bit complex because it tries to handle such edge cases so I would like to insist on keeping it simple where possible.
Also thanks for making this fix!
Follow-up for #88930
Currently, CH fails to read from buckets that are located in opt-in AWS regions if region is not specified in query explicitly:
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Allow using opt-in AWS regions for S3 automatically when the region is not specified in the endpoint. Reference: opt-in AWS regions.