Live data from Hacker News

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

old.reddit.com

101–110 of 142 posts

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

#101

Earlier quoted context omitted.

while C only once You listed C twice

That's a typo. You can still see they're correct about the ratio (two "C"s for every three "A"s and "B"s).

There's no ratio. It's even across all of them, as long as the integer keeps incrementing. One more number (9) instead of stopping at 8 and there would be an even spread.

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

#102

Earlier quoted context omitted.

The bug never existed at all in Civ 1. It was an urban legend all along. Similar behavior was intentional in Civ 5 as a joke, which convinced everyone that it really did happen in Civ 1 when it never did.

Mandela effect

It's the result of people repeating what they read on the Internet, not what they personally experienced.

This happens way too often

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

#103
post #3

A long time ago we discovered Twitter used a round robin of three servers for assigning IDs to tweets. We inferred the round robin was done by doing mod 3 of a signed int32, and because that space doesn't divide neatly by two it meant one of the three servers saw less load than the others and we could map ID assignment volume according to how often it overflowed and hence estimate total tweet volume for a given perio…

I am pretty sure that snowflake didn't use a mod of a signed int32. It used a service discovery pool as part of finagle (and prior to that dns iirc). The server used a very simple method internally to convert time into a integer (that was 52 bits because of javascript). In fact it was completely open source: https://blog.twitter.com/engineering/en_us/a/2010/announcing... The integer generation was pretty simple, ther…

A simpler scheme I've used for adtech (billions of requests per day) is to simply reserve a chunk of numbers for each server from a central source. Easy to implement, very fast since each node can just increment in process, and using a 64-bit integer is effectively infinite.

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

#104

Earlier quoted context omitted.

This is really a false dichotomy you don't have to use guid/uuid. I'm saying even if you use sortable auto increment numbers, stop storing them like numbers.

Doesn't numeric storage save space and make indexing faster? (This is a naive question, I'm not asserting it.) Yeah, numbers get you fun stuff like overflows and wrap-arounds, etc. But sorting is faster (sorting "99" before "100" is more complex than 99 before 100) and space requirement is lower (6 bytes can store a unique ID for 281 trillion objects, but 6 characters only permits 1 million if you're storing them as…

XID wraparound is one of the things that makes me wish Postgres would go 64bit on some of their internal data structures.

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

#106
post #89

Earlier quoted context omitted.

The GP said it would have "bought Reddit a lot of time," the post I responded to said it was merely 2^31 implying that it wouldn't have bought them a lot of time, that's the part I was replying to (though I didn't word it clearly). 2 billion more values would have bought Reddit a lot of time. I should have taken more time to read over both posts and respond more clearly though

Ah, I read the GP as a correction that it wasn't 2^16, but 2^31 values. The "doubling" was correctly stated, but the edit said they only had 2^16 values to work with. Almost certainly just a mistake in the post.

Yeah I think we're all in agreement here.

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

#107

Earlier quoted context omitted.

That's a typo. You can still see they're correct about the ratio (two "C"s for every three "A"s and "B"s).

There's no ratio. It's even across all of them, as long as the integer keeps incrementing. One more number (9) instead of stopping at 8 and there would be an even spread.

Not when the counter overflows back to 0. If it's a 3 bit counter, 0 is A again, not C.

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

#108

Earlier quoted context omitted.

Take a 3-bit counter: 0->A 1->B 2->C 3->A 4->B 5->C 6->A 7->B A and B get hit three times while C only twice, so it will see 66% utilization compared to A and B EDITED s/once/twice/ thanks CyberDildonics

That doesn't change anything... it's still round robin. You just stopped at an arbitrary number of 8 integers instead of 9.

It's not arbitrary, GP stated it was a 3 bit counter. In GGP (or something, not sure how far down in the thread we are), they were referring to a 32 bit int counter until overflow. If you bin each number from 0 to 2^32 - 1 by mod 3, you don't get 3 bins of equal sizes, 1 bin always comes out smaller.

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

#110

Earlier quoted context omitted.

There's no ratio. It's even across all of them, as long as the integer keeps incrementing. One more number (9) instead of stopping at 8 and there would be an even spread.

Not when the counter overflows back to 0. If it's a 3 bit counter, 0 is A again, not C.

The comment says a 32-bit signed int. Where is the 3-bit assumption coming from?
Post reply on HN