-
Notifications
You must be signed in to change notification settings - Fork 134
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
64bit connection id may break slow query detail #791
Comments
Does it work by using string type in the response? |
TBH I'd prefer using Or we could restrict the Global connection ID to use only 53 bits 🙃, reducing the range from 22(server ID) + 40(local conn) to 18(server ID) + 34(local conn). |
Prefer json-bigint +1 We'd better not changing the global connection ID bit structure since this is a fault of JavaScript instead of connection ID. |
Some discovery:
Related discussions: |
can we map the BigInt toString before passing to swagger? |
@kennytm We could. However this loses its advantage. Public interfaces are no longer semantically correct, server side API and Swagger specs both accept In PR #793 I simply change |
(filed nodejs/node#36080 for bigint support in querystring) (but why are we using nodejs?) |
We are using Webpack, so that in addition to NodeJs support, we also need to expect browser polyfills to work correctly. According to https://medium.com/@sanchit3b/how-to-polyfill-node-core-modules-in-webpack-5-905c1f5504a0, url and querystring will be mapped to corresponding module in npm, e.g. https://www.npmjs.com/package/querystring |
ok. looks like even if we get nodejs/node#36080 fixed it will take a long time for us to support older nodejs versions in other dev environments 😅 |
Since https://github.com/tc39/proposal-bigint is a very new feature, neither the surrounding ecology nor Polyfill is mature. Once bigint is used, it needs to introduce a lot of additional processing code to pollute the workflow and code. |
@unbyte Yes. The only defect is that it makes Dashboard server API dirty. This API is internal for now but may be open to public in future. I hope one day we can change it back. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
What did you do?
TiDB generates 64bit connection id since pingcap/tidb#17649. In some cases, the slow query detail page cannot correctly handle this case due to JavaScript max int limitation.
What did you expect to see?
Slow query detail work correctly.
What did you see instead?
Slow query detail may throw error.
What version of TiDB Dashboard are you using (
./tidb-dashboard --version
)?The text was updated successfully, but these errors were encountered: