Repository navigation
Eliminates the possibilities of counter overflows. - #554
Conversation
|
The ultimate destination for this value is the Is there a particular reason you coded up this fix? It seems weird to go through the trouble of changing this type to |
There was a problem hiding this comment.
If we do go ahead with this review, the %ld should be INT64_FORMAT and not a literal %ld.
There was a problem hiding this comment.
Oh, I wasn't aware of that. Thanks.
|
The documentation for Practically, the actual code that generates the command tag either emits With all that in mind, the original code does have the problem that it returns an Maybe the best solution would be to:
Does that all make sense? Am I missing something? |
|
Hmm. I was referring to the master branch of postgres where the |
Heh. When I was reading this I thought to myself maybe there's some change in
Well, I'd like to have have a function check and throw rather than have a silent truncation, wrap, etc. So this is still an improvement. Still, it'd be nice to scan as a It sounds like this is a little more tricky than I initially thought. I'll bring it up with a teammate and get back to you (for instance, now I'm wondering about a scenario where a 9.5 master is talking to 9.6 workers, and to what degree we need to gracefully support that, warn, or fail). Thanks for the explanation. |
|
Hey Amos Bird (@amosbird)… sorry for the delay. After talking this over, we're OK with this approach:
This doesn't handle values greater than With the above, that's a |
This patch uses scanint8 instead of pg_atoi to make sure the affected tuples counter never gets overflow.
ec38829 to
fd1b088
Compare
|
Hi Jason Petersen (@jasonmp85) , I've updated the patch hopefully as you described 😄 |
|
This looks great! I'm going to fix up some of the formatting with our style tool and I'll get this merged in. |
|
Thanks for your contributions! |
|
Jason Petersen (@jasonmp85) Oh, I've used the citus_indent to format the patch. It seems I didn't get it right. |
|
Amos Bird (@amosbird) no problem; it wasn't stuff |
This patch uses scanint8 instead of pg_atoi to make sure the affected
tuples counter never gets overflow.