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

[ISSUE #5078] set default pageSize to 1000 for getting all the subscribers in other server node. #5424

Merged
merged 3 commits into from
Apr 23, 2021

Conversation

brotherlu-xcq
Copy link
Collaborator

Please do not create a Pull Request without creating an issue first.

What is the purpose of the change

Fixes #5078

由于每台机器的subscribers的数量都可能超过pageSize,所以暂时没有使用查本地再去查远程服务的方式。因为在做翻页的时候,必须要告诉后端已经查询了哪些机器,这样才能确认这一次查询需要查询那些机器,这样复杂度会很高,改动范围会比较大。所以暂时考虑用这种方式修复此问题。

Brief changelog

XX

Verifying this change

XXXX

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

  • Make sure there is a Github issue filed 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 [ISSUE #123] Fix UnknownException when host config not exist. 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 integration-test in test module.
  • Run mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.

int pageNo = NumberUtils.toInt(WebUtils.required(request, "pageNo"));
int pageSize = NumberUtils.toInt(WebUtils.required(request, "pageSize"));
int pageNo = NumberUtils.toInt(WebUtils.optional(request, "pageNo", "1"));
int pageSize = NumberUtils.toInt(WebUtils.optional(request, "pageSize", "10000"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉在这里用缺省值开头太大了,这个是open api,用户可以直接使用,建议还是通过在请求时设置参数。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以,我待会换种方式,但是暂时还是建议通过大数值这种方式修复这个问题。

Copy link
Collaborator

@KomachiSion KomachiSion Apr 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

前端传递的代码是有pageSize和pageNo的,我觉得可以暂时先透传到其他server端。

之后再修改和优化查询逻辑。

缺醒值可以有,但是必须小。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那我暂时把缺省值将为1000,这个基本就是查所有了。

int pageNo = NumberUtils.toInt(WebUtils.required(request, "pageNo"));
int pageSize = NumberUtils.toInt(WebUtils.required(request, "pageSize"));
int pageNo = NumberUtils.toInt(WebUtils.optional(request, "pageNo", "1"));
int pageSize = NumberUtils.toInt(WebUtils.optional(request, "pageSize", "10000"));
Copy link
Collaborator

@KomachiSion KomachiSion Apr 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

前端传递的代码是有pageSize和pageNo的,我觉得可以暂时先透传到其他server端。

之后再修改和优化查询逻辑。

缺醒值可以有,但是必须小。

Copy link
Collaborator

@KomachiSion KomachiSion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不传递pageNo和Size吗? 光靠默认值肯定是不行的。

@brotherlu-xcq
Copy link
Collaborator Author

好的,我待会调整一下,疏忽了这个问题。

@KomachiSion KomachiSion merged commit 6c270cb into alibaba:develop Apr 23, 2021
@KomachiSion KomachiSion changed the title [ISSUE #5078] set default pageSize to 10000 for getting all the subscribers in other server node. [ISSUE #5078] set default pageSize to 1000 for getting all the subscribers in other server node. Apr 23, 2021
@KomachiSion KomachiSion added the kind/bug Category issues or prs related to bug. label Apr 23, 2021
@KomachiSion KomachiSion added this to the 1.4.2 milestone Apr 23, 2021
@brotherlu-xcq brotherlu-xcq deleted the fix-#5078 branch April 23, 2021 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

控制台中订阅者列表数据,多次查询的结果不一致
3 participants