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

consumer config tag override privode tag config #5975

Merged
merged 1 commit into from
Apr 16, 2021

Conversation

zhouhaopeng
Copy link

@zhouhaopeng zhouhaopeng commented Apr 7, 2020

What is the purpose of the change

fix #5971

fix tag router select wrong provider issue
Report
XXXXX 'Provider--A with no tag, Provider--B with tag (dubbo.tag=grey)'

  1. Consumer with no tag, do select get A;
  2. Consumer with tag(grey), do select get B;
  3. Consumer with attachment(dubbo.tag=grey), do select get B;
  4. Consumer with tag(grey_), do select get A;

Verifying this change

ClusterUtils.class

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a GITHUB_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Run mvn clean install -DskipTests=false & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
  • If this contribution is large, please follow the Software Donation Guide.

@zhouhaopeng
Copy link
Author

zhouhaopeng commented May 21, 2020 via email

@KevinClair
Copy link
Member

provider端tag配置会被consuer端配置覆盖 wuzunqian notifications@github.com 于2020年5月15日周五 下午6:10写道:

我遇到了相同的问题 dubbo2.7.6 官网描述: 降级约定 request.tag=tag1 时优先选择 标记了tag=tag1 的 provider。若集群中不存在与请求标记对应的服务,默认将降级请求 tag为空的provider;如果要改变这种默认行为,即找不到匹配tag1的provider返回异常,需设置request.tag.force=true。 request.tag未设置时,只会匹配tag为空的provider。即使集群中存在可用的服务,若 tag 不匹配也就无法调用,这与约定1不同,携带标签的请求可以降级访问到无标签的服务,但不携带标签/携带其他种类标签的请求永远无法访问到其他标签的服务。 目前现象: request.tag未设置时,匹配到有tag的provider — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#5975 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIZUKHSPMYKRSHOJSFLNGJTRRUIKZANCNFSM4MCXRYMQ .

您好,请问一下provider端tag配置会被consuer端配置覆盖具体是什么意思,我在2.7.7版本遇到了这样的问题,没有设置tag的consumer通过泛化调用了设置了tag的provider,这与约定的tag降级方式有差别。

@zhouhaopeng
Copy link
Author

zhouhaopeng commented Dec 31, 2020 via email

@KevinClair
Copy link
Member

我遇到的问题和上面的同学遇到的一样,request.tag未设置时,匹配到有tag的provider,request.tag设置时,会匹配到携带tag的provider,如果不存在这样的provider,会报错。

@zhouhaopeng
Copy link
Author

zhouhaopeng commented Dec 31, 2020 via email

@KevinClair
Copy link
Member

是这个pr吗?能解决的话,我们就本地打包了。

@zhouhaopeng
Copy link
Author

zhouhaopeng commented Dec 31, 2020 via email

@KevinClair
Copy link
Member

好的,感谢。

@AlbumenJ AlbumenJ merged commit aaa9158 into apache:master Apr 16, 2021
AlbumenJ added a commit that referenced this pull request Apr 16, 2021
AlbumenJ added a commit to AlbumenJ/dubbo that referenced this pull request May 28, 2021
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.

[Issue] The TagRouter maybe have one issue
3 participants