Source-based routing support #1422
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1422
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:feat/multinet"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Added source based routing (aka multinet) support for grpc clients, tree service and morph.
before:
after:
Perf tests:
master:
branch:
e205b686e8
to3ddc094211
3ddc094211
toec6611b496
ec6611b496
to8cd3a83709
1ebce64242
to05c39655b9
05c39655b9
tof041c072ac
f041c072ac
to0d129151f2
0d129151f2
to3989b97c92
3989b97c92
toccb3cc0a1f
ccb3cc0a1f
to1ff0e20c7b
d12a90465d
to1591e3fbf5
1591e3fbf5
tof143081728
f143081728
to4d27e1d266
WIP: Source-based routing supportto Source-based routing supportSo, no difference for PUT but non-negligible improvement for GET. How can we explain it?
The difference in the results does not look significant. These were short tests (15 minutes), the main purpose of which was to confirm that there was no significant degradation.
@ -134,0 +139,4 @@
cfg.SetDefault("multinet.balancer", "")
cfg.SetDefault("multinet.restrict", false)
cfg.SetDefault("multinet.fallback_delay", "0s")
cfg.SetDefault("multinet.subnets", "")
Shouldn't it be an empty list?
It works so. To specify empty list it is required to add
Subnet
type to IR config, but this is only required to set defaults.I've meant
"[]"
, but if it already works, ok.@ -0,0 +18,4 @@
}
func newDefaulDialer() net.Dialer {
// From `grpc.WithContextDialer` comment:
Could you provide a link to github?
done
@ -0,0 +20,4 @@
func newDefaulDialer() net.Dialer {
// From `grpc.WithContextDialer` comment:
//
// Note: All supported releases of Go (as of December 2023) override the OS
Why do we care about it in this PR?
multinet
is used primarily for gprs connections, so I think it's important to preserve the behavior of the standard grpc library.Also I think it's correct to use OS settings for keep alive.
@ -0,0 +43,4 @@
// Dialer returns configured Dialer and True, if source based routing enabled.
// Otherwise returns nil and False.
func (s *DialerSource) Dialer() (Dialer, bool) {
Frankly, this is a rather generic package (it is even called
net
)Why don't we return
Dialer
only?It seems every client of this function has to check the second return value and use the same default otherwise.
fixed
@ -0,0 +18,4 @@
if sourceIP != nil {
sourceIPString = sourceIP.Network() + "://" + sourceIP.String()
}
statusString := "OK"
We have
success bool
in many other places, why do we go withstatus
here?In the distant bright future, it may be necessary to have separated error types, for example, for failover scenarios.
Do you mean for this error or for everything?
I would rather be consistent across the codebase.
Also, what different kinds of errors do you have in mind?
For example, it may be necessary to distinguish between errors of the server to which the connection is being made and errors of the network interface through which the connection is being made.
I doubt we will do sth like this in the near future (remember: it is
Dial
, not some protocol method, so there is no status)And if we will or will need to, we can always add a label.
fixed
@ -63,0 +76,4 @@
d, enabled := x.opts.DialerSource.Dialer()
if enabled {
grpcOpts = append(grpcOpts, grpc.WithContextDialer(func(ctx context.Context, s string) (net.Conn, error) {
return internalNet.DialContextTCP(ctx, s, d)
Unix domain sockets can be used:
830135e6c5/internal/transport/http2_client.go (L159)
We should parse the address and return an explicit error if we do not support this.
Fixed. unix sockets may be supported if
restrict = false
.@ -104,0 +108,4 @@
d, enabled := c.ds.Dialer()
if enabled {
opts = append(opts, grpc.WithContextDialer(func(ctx context.Context, s string) (net.Conn, error) {
return internalNet.DialContextTCP(ctx, s, d)
Same here -- it can be
unix://
fixed
4d27e1d266
to4f26aba3f2
New commits pushed, approval review dismissed automatically according to repository settings
4f26aba3f2
tobe3fab65ab
@ -0,0 +41,4 @@
}
// parseDialTarget returns the network and address to pass to dialer.
// From https://github.com/grpc/grpc-go/blob/830135e6c5a351abf75f0c9cfdf978e5df8daeba/internal/transport/http_util.go#L443
Do we need to copy some copyright or license here if we reuse code?
done
be3fab65ab
tod9feca670c
d9feca670c
to5b9aa3fcf3
pkg/morph/client.WithDialSource()
takes internal structure as parameter #1456