-
Notifications
You must be signed in to change notification settings - Fork 3
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
Load balance support #65
Load balance support #65
Conversation
Expect(allSettings.ConfigMapSettings["app:test:"]).Should(Equal("value6")) | ||
}) | ||
|
||
It("Succeed to get settings when load balance not enabled", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the test necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, test only single client used (line 1311) when load balance not enabled.
internal/loader/request_tracing.go
Outdated
if provider.Spec.ReplicaDiscoveryEnabled { | ||
if manager, ok := clientManager.(*ConfigurationClientManager); ok { | ||
replicaCount := 0 | ||
if manager.DynamicClientWrappers != nil { | ||
replicaCount = len(manager.DynamicClientWrappers) | ||
} | ||
|
||
output = append(output, fmt.Sprintf("ReplicaCount=%d", replicaCount)) | ||
|
||
if manager.IsFailoverRequest { | ||
output = append(output, "FailoverRequest") | ||
} | ||
} | ||
} | ||
|
||
if provider.Spec.LoadBalancingEnabled { | ||
output = append(output, "UsesLoadBalancing") | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please align the format with .net provider
if err != nil { | ||
successful = false | ||
updateClientBackoffStatus(clientWrapper, successful) | ||
if IsFailoverable(err) { | ||
klog.Warningf("current client of '%s' failed to get settings: %s", clientWrapper.Endpoint, err.Error()) | ||
errors = append(errors, err) | ||
if ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
here just means it can find the RequestTracingEnabled in env var. I don't get the point here.
@@ -37,6 +37,8 @@ import ( | |||
|
|||
type ConfigurationClientManager struct { | |||
ReplicaDiscoveryEnabled bool | |||
LoadBalancingEnabled bool | |||
IsFailoverRequest bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's required to be a property in ConfigurationClientManager
, we don't need to remember the state of IsFailoverRequest
* load balance support * update load balance tracing * upgrade golangci version * update * skip cache for golangci lint * update * update * update envtest version * update envtest tool version * add cancel context * resolve comments * fix lint error * no need to update isFailoverRequest when succeed to get settings
Support load balance when
replicaDiscoveryEnabled
Add load balance and failover request tracing