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

最小步长设置问题 #200

Open
leechliao opened this issue Aug 15, 2022 · 1 comment
Open

最小步长设置问题 #200

leechliao opened this issue Aug 15, 2022 · 1 comment

Comments

@leechliao
Copy link

buffer.setMinStep(leafAlloc.getStep());

我理解是否应该是只需在buffer的初始化设置一次足以,不用在后续每次重复设置

@wangjibo0102
Copy link

wangjibo0102 commented Sep 1, 2022

这个是基于时间动态计算的,如果15分钟内就需要预加载下一段segment,那么step就是扩大2倍,如果是30分钟内则step保持不变,如果是30分钟以上则当前step除以2并和数据库中的step做比较,取最小值。这个操作原则上是防止在并发获取id时,由于数据库step配置太小,导致频繁访问数据库
image

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

No branches or pull requests

2 participants