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

feat: s3/transfermanager (v2): round-robin DNS and multi-NIC #2975

Merged
merged 4 commits into from
Jan 21, 2025

Conversation

lucix-aws
Copy link
Contributor

Add two functional options to configure http.Transport to do the following:

  • round-robin DNS - S3 returns up to 8 DNS records per query, this injects a custom resolver that ensures new connections rotate between these IP addresses.
  • multi-value NIC - replaces the underlying DialContext hook with one that cycles between supplied local addresses (NICs).

@lucix-aws lucix-aws requested a review from a team as a code owner January 21, 2025 17:38
@lucix-aws lucix-aws changed the title Feat transfer manager v2 rrdns feat: s3/transfermanager (v2): round-robin DNS and multi-NIC Jan 21, 2025
if ok {
return addr, nil
}
return r.lookupHost(ctx, host)
Copy link
Contributor

Choose a reason for hiding this comment

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

So when we have a cache miss we'll refresh the whole cache? is this what we want?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not the whole cache? We just re-query for that one host, or am I missing something?

Copy link
Contributor Author

@lucix-aws lucix-aws Jan 21, 2025

Choose a reason for hiding this comment

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

cache is hostname -> []<ip address>

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right, my thinking was that we were storing things like

hostname -> {
  ip1/expiry1
  ip2/expiry2
  ip3/expiry3
}

But we're storing all results of the lookup with the same expiry (since we don't get TTL), so the entries are

hostname -> {
  ip1/expiry1
  ip2/expiry1
  ip3/expiry1
}

Then it doesn't really matter if one expires since all entries from the lookup will expire at the same time. And anyway, anytime we do a lookup for the same hostname, we replace existing values so they effectively always have the same expiry

@lucix-aws lucix-aws merged commit 7c31a8c into feat-transfer-manager-v2 Jan 21, 2025
11 checks passed
@lucix-aws lucix-aws deleted the feat-transfer-manager-v2-rrdns branch January 21, 2025 22:33
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.

3 participants