-
Notifications
You must be signed in to change notification settings - Fork 441
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
Convert all stats from INT8 -> NUMERIC(20, 0) #401
Conversation
3e539dd
to
03ed622
Compare
809e635
to
2f96bef
Compare
Internally these statistics are stored as unsigned 64-bit values, but the PostgreSQL INT8 types can only express signed 64-bit values. Convert all the stats to NUMERIC(20, 0) to avoid losing data. Closes pgbouncer#360
688f4ea
to
9136559
Compare
Improve documentation for NUMERIC typmod
9136559
to
e8c1aed
Compare
@petere Would you mind reviewing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good at first glance. I'll work on integrating this.
@petere Friendly ping. We got bit by recently by a problem with not having metrics for a subset of our PgBouncer hosts. Can we look into rolling this in soon? |
I want to go through all the admin and stats commands and check for similar data type mismatch/overflow problems. I think there are a few more. It will need a bit more time. |
Internally, most statistiscs are kept as uint64_t. Sending those with a row descriptor that claims they are bigint can lead to problems if uint64_t values can overflow the signed 64-bit integer range. Then a client library that wants to convert the value to its locally appropriate signed 64-bit integer type would run into errors. based on patch by @stanhu fixes pgbouncer#360 pgbouncer#401
a fix has been committed |
@petere Thanks, could you cut a new release for PgBouncer? |
yes :) |
Internally these statistics are stored as unsigned 64-bit values,
but the PostgreSQL INT8 types can only express signed 64-bit values.
Convert all the stats to NUMERIC(20, 0) to avoid losing data.
Closes #360