Live data from Hacker News

Reddit's photo albums broke due to Integer overflow of Signed Int32

old.reddit.com

141–142 of 142 posts

Re: Reddit's photo albums broke due to Integer overflow of Signed Int32

#141

Earlier quoted context omitted.

You're certainly right that overflow isn't special to numbers, but my disdain for ids being treated as numbers mostly revolves around how common incidents like this are and how often a safe decision results in tempting developers to make unsafe decisions for api consistency. Suppose you store your ids as a 64 bit number in the database, that's plenty of room, we shouldn't need to put an alarm for when we're reaching…

> stop letting developers trust numbers as being self-bound Sorry, I thought I was following you, but I don't understand the last half of this quote. What does "trust as self-bound" mean?

Sorry, I could have phrased that better. Bound and validated by their container. Since an int has natural boundaries while a string could easily overflow a varchar, it's much easier to assume that less validation is needed. But maintaining consistent numeric containers across serialization boundaries is often just as likely to overflow or have encoding difficulties as strings. My assertion is developers don't trust strings and validate them by default more often than integers or numbers.

Re: Reddit's photo albums broke due to Integer overflow of Signed Int32

#142

Earlier quoted context omitted.

When you divide 2^32 across 3 machines, you get 1431655766, 1431655765, 1431655765. They're nearly identical, just an itsy bitsy bit different. This isn't going to cause one machine to have noticeably less load than the others.

That's not what's being discussed here though.

Then what is being discussed? I thought this thread was about 3 servers, of which one has lower load due to an int32 overflowing.
Post reply on HN