-
Notifications
You must be signed in to change notification settings - Fork 929
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
Ftr: Use invoker with same ip as client first. #1023
Ftr: Use invoker with same ip as client first. #1023
Conversation
…lop/github.com/dubbogo/gost-1.11.0 Bump github.com/dubbogo/gost from 1.10.1 to 1.11.0
Codecov Report
@@ Coverage Diff @@
## develop #1023 +/- ##
===========================================
- Coverage 59.49% 59.38% -0.11%
===========================================
Files 261 263 +2
Lines 12950 12988 +38
===========================================
+ Hits 7704 7713 +9
- Misses 4273 4301 +28
- Partials 973 974 +1
Continue to review full report at Codecov.
|
* limitations under the License. | ||
*/ | ||
|
||
package self_disc |
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.
dont use _
in package name. I think can change to self
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.
Fixed
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 think consistency for directory name and package name will not lead to misunderstanding.
And directory name should not be ‘aB’
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 think consistency for directory name and package name will not lead to misunderstanding.
And directory name should not be ‘aB’
fixed
) | ||
|
||
const ( | ||
selfDesc = "self-desc" |
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.
Can you use common.SelfDiscoveryRouterName
?
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.
common.SelfDiscoveryRouterName
is to find out registered router.
selfDesc
is to find the bitmap of target router in cache.
In order to be consistent with the code design of other routers, I think your suggesting way can be confusing.
@@ -176,6 +176,8 @@ github.com/dubbogo/go-zookeeper v1.0.2/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4D | |||
github.com/dubbogo/gost v1.9.0/go.mod h1:pPTjVyoJan3aPxBPNUX0ADkXjPibLo+/Ib0/fADXSG8= | |||
github.com/dubbogo/gost v1.10.1 h1:39kF9Cd5JOiMpmwG6dX1/aLWNFqFv9gHp8HrhzMmjLY= | |||
github.com/dubbogo/gost v1.10.1/go.mod h1:+mQGS51XQEUWZP2JeGZTxJwipjRKtJO7Tr+FOg+72rI= | |||
github.com/dubbogo/gost v1.11.0 h1:9KtyWQz1gMlAfwzen5iyhMdoe08SPBBUVhco4rdgJ9I= | |||
github.com/dubbogo/gost v1.11.0/go.mod h1:w8Yw29eDWtRVo3tx9nPpHkNZnOi4SRx1fZf7eVlAAU4= |
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.
using go mod tidy
to delete the useless gost version.
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.
fixed
cluster/router/self/factory.go
Outdated
* limitations under the License. | ||
*/ | ||
|
||
package self |
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.
pls change the pkg name
selectedInvokers := utils.JoinIfNotEqual(addrPool[selfPriority], invokers) | ||
// If all invokers are considered not match, downgrade to all invoker | ||
if selectedInvokers.IsEmpty() { | ||
logger.Warnf(" Now all invokers are not match, so downgraded to all! Service: [%s]", url.ServiceKey()) |
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.
maybe it should be logger.Debugf
|
||
// Priority | ||
func (r *SelfPriorityRouter) Priority() int64 { | ||
return 0 |
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.
the priority should be latest
pls change the target branch to 1.5 |
Ftr: Use invoker with same ip as client first.
What this PR does:
Add feature :
After client gets invoker lists from registry, if there is provider with the same ip as client, client would use the same ip first, which is not using wide network and faster.
If it not exists the same ip provider, it would handle as normal way.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
I add a router named selfDiscovery, which contains the router logic above.
Does this PR introduce a user-facing change?: