<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.5</li>
<li>Operating System version: macos 10.15.2</li>
<li>Java version: openJDK8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>create a service named Greeting service</li>
<li>startup two nacos instances representing as two registry center in two different zones.</li>
<li>startup two greeting service instances registering to both nacos registry with different registry id</li>
<li>startup one consumer instance registering to both nacos registry with different zone id.</li>
<li>use consumer to call greeting service with cluster=zone-aware and registry_zone parameter.</li>
</ol>
<p dir="auto">The code is simple so I will ignore them and just paste properties as below:</p>
<p dir="auto">#Provider#</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dubbo.protocol.name=dubbo
dubbo.protocol.port=12345

dubbo.config.multiple=true
dubbo.registries.a.id=nuc
dubbo.registries.a.address=nacos://127.0.0.1:8848
dubbo.registries.a.zone=nuc
dubbo.registries.a.use-as-config-center=false
dubbo.registries.b.id=mbp
dubbo.registries.b.address=nacos://192.168.1.31:8848
dubbo.registries.b.zone=mbp
dubbo.registries.b.use-as-config-center=false"><pre class="notranslate"><code class="notranslate">dubbo.protocol.name=dubbo
dubbo.protocol.port=12345

dubbo.config.multiple=true
dubbo.registries.a.id=nuc
dubbo.registries.a.address=nacos://127.0.0.1:8848
dubbo.registries.a.zone=nuc
dubbo.registries.a.use-as-config-center=false
dubbo.registries.b.id=mbp
dubbo.registries.b.address=nacos://192.168.1.31:8848
dubbo.registries.b.zone=mbp
dubbo.registries.b.use-as-config-center=false
</code></pre></div>
<p dir="auto">#Consumer#</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="server.port=0
## Dubbo Registry
dubbo.registry.address=nacos://127.0.0.1:8848?zone=nuc|nacos://192.168.1.31:8848?zone=mbp
dubbo.registry.zone
dubbo.registry.use-as-config-center=false"><pre class="notranslate"><code class="notranslate">server.port=0
## Dubbo Registry
dubbo.registry.address=nacos://127.0.0.1:8848?zone=nuc|nacos://192.168.1.31:8848?zone=mbp
dubbo.registry.zone
dubbo.registry.use-as-config-center=false
</code></pre></div>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    public String hello(String name) {
        logger.info(name);
        RpcContext.getContext().setAttachment(&quot;cluster&quot;, &quot;zone-aware&quot;);
        RpcContext.getContext().setAttachment(&quot;registry_zone&quot;, &quot;nuc&quot;);
        return greetingService.sayHelloTo(name);
    }"><pre class="notranslate">    <span class="pl-k">public</span> <span class="pl-smi">String</span> <span class="pl-s1">hello</span>(<span class="pl-smi">String</span> <span class="pl-s1">name</span>) {
        <span class="pl-s1">logger</span>.<span class="pl-en">info</span>(<span class="pl-s1">name</span>);
        <span class="pl-smi">RpcContext</span>.<span class="pl-en">getContext</span>().<span class="pl-en">setAttachment</span>(<span class="pl-s">"cluster"</span>, <span class="pl-s">"zone-aware"</span>);
        <span class="pl-smi">RpcContext</span>.<span class="pl-en">getContext</span>().<span class="pl-en">setAttachment</span>(<span class="pl-s">"registry_zone"</span>, <span class="pl-s">"nuc"</span>);
        <span class="pl-k">return</span> <span class="pl-s1">greetingService</span>.<span class="pl-en">sayHelloTo</span>(<span class="pl-s1">name</span>);
    }</pre></div>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">I'm confused here, I don't know what to expect. According to the explanation by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/chickenlj/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/chickenlj">@chickenlj</a>  in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="529961090" data-permission-text="Title is private" data-url="https://github.com/apache/dubbo/issues/5399" data-hovercard-type="issue" data-hovercard-url="/apache/dubbo/issues/5399/hovercard" href="https://github.com/apache/dubbo/issues/5399">#5399</a> , One provider instance such as B1 should be able to register to multiple registries in the same time.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/18097545/70682056-8ea65300-1cd8-11ea-8e9b-cf6284e04e48.png"><img src="https://user-images.githubusercontent.com/18097545/70682056-8ea65300-1cd8-11ea-8e9b-cf6284e04e48.png" alt="" style="max-width: 100%;"></a></p>
<p dir="auto">But ZoneAware policy is being executed in ClusterInvoker level. The ZoneAwareClusterInvoker use zone value to decide which FailoverClusterInvoker (contains RegsitryDirectory). I know there is a bug in 2.7.5 that will drop zone parameter <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="550012880" data-permission-text="Title is private" data-url="https://github.com/apache/dubbo/issues/5654" data-hovercard-type="issue" data-hovercard-url="/apache/dubbo/issues/5654/hovercard" href="https://github.com/apache/dubbo/issues/5654">#5654</a> , but this doesn't matter. Even if that is fixed in 2.7.6, the problem is still there, that is:</p>
<p dir="auto">you choose the right registry, but the registry still list all available DubboInvoker (B1, B2), meanwhile, there is no LoadBalance based on zone value as there is no such value on provider. The consumer A1 can still go to B2 even when B1 is alive.</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">When using zone-aware policy, should one service instance can only register to one registry? but this will lose the ability to use services in other zone as a backup. Am I missing something?...</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 0.2.0</li>
<li>Operating System version: mac</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/20470232/46243870-01e0e380-c40b-11e8-88f4-8e07ab4a4079.png"><img src="https://user-images.githubusercontent.com/20470232/46243870-01e0e380-c40b-11e8-88f4-8e07ab4a4079.png" alt="image" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/20470232/46243934-aa8f4300-c40b-11e8-9cc0-9349eada7a3f.png"><img src="https://user-images.githubusercontent.com/20470232/46243934-aa8f4300-c40b-11e8-9cc0-9349eada7a3f.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">本应该注入两个协议，但实际上一个协议都没注入</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">启动spring boot 找不到指定协议名的bean</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/20470232/46243908-48364280-c40b-11e8-928a-46e138a7648c.png"><img src="https://user-images.githubusercontent.com/20470232/46243908-48364280-c40b-11e8-928a-46e138a7648c.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">！！而且注入失败也没有提示，不调试根本无感知</p>
<p dir="auto">测试单个注入不管是jsonrpc还是dubbo都可以成功，但是多个注册就根本注册失败</p>