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

The storage leader address for the partition of metaManager cache does not look correct #354

Open
iiibui opened this issue Sep 22, 2021 · 3 comments
Assignees
Labels
good first issue Good for newcomers type/enhancement Type: make the code neat or more efficient type/question Type: question about the product

Comments

@iiibui
Copy link

iiibui commented Sep 22, 2021

对应代码:

spacesInfo.get(spaceName).partsAlloc.get(partId).get(0));

GetPartsAllocReq返回的分区信息无法确定哪个host是leader吧?代码取了第一个,对比 ListHosts 返回的 LeaderParts,第一个并不是 Leader Host。我是参考这里的 https://github.com/vesoft-inc/nebula-common/blob/master/src/common/clients/meta/MetaClient.cpp#L3189

另外 StorageClient 目前只有 scanXXX 接口,有无计划补全剩下的接口?

@Nicole00
Copy link
Contributor

Nicole00 commented Sep 26, 2021

对应代码:

spacesInfo.get(spaceName).partsAlloc.get(partId).get(0));

GetPartsAllocReq返回的分区信息无法确定哪个host是leader吧?代码取了第一个,对比 ListHosts 返回的 LeaderParts,第一个并不是 Leader Host。我是参考这里的 https://github.com/vesoft-inc/nebula-common/blob/master/src/common/clients/meta/MetaClient.cpp#L3189

另外 StorageClient 目前只有 scanXXX 接口,有无计划补全剩下的接口?

  1. GetPartsAlloc just returns the hosts of part, we cann't know which one is the leaser host. The leader host is generated by caller's retry. If the host is not leader, then the response will has LEADER_CHANGE error code, and the true leader will be contained in response. Refer
  2. For now, we don't have plan to support more operation interfaces. Thanks for your attention.

@iiibui
Copy link
Author

iiibui commented Sep 28, 2021

Oh, I see. Why not use ListHosts to get the right storage leaser host of part in initialization like cpp client to reduce one possible failed request? Because of compatibility?

@klay-ke klay-ke changed the title MetaManager缓存的分区对应Leader地址有误 The leader address for the partition of metaManager cache does not look correct Sep 28, 2021
@iiibui iiibui changed the title The leader address for the partition of metaManager cache does not look correct The storage leader address for the partition of metaManager cache does not look correct Sep 28, 2021
@klay-ke klay-ke added the type/question Type: question about the product label Sep 28, 2021
@Nicole00
Copy link
Contributor

Oh, I see. Why not use ListHosts to get the right storage leaser host of part in initialization like cpp client to reduce one possible failed request? Because of compatibility?

Yeah, it's a meaning point. When develop the scan process, we use the habitual positive thinking to get part's hosts. And you're right, using listHosts will be more effective.

@Nicole00 Nicole00 added type/enhancement Type: make the code neat or more efficient good first issue Good for newcomers labels Dec 29, 2022
@Nicole00 Nicole00 self-assigned this Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type/enhancement Type: make the code neat or more efficient type/question Type: question about the product
Projects
None yet
Development

No branches or pull requests

3 participants