3 ms·
Long long ago in a previous century, I worked on a project with a "seasonal" production cycle (develop for six months, run it for six months, etc). I spent a de
by beat 10y ago
Long long ago in a previous century, I worked on a project with a "seasonal" production cycle (develop for six months, run it for six months, etc). I spent a dev cycle on a project to pull scanned image storage out of Sybase BLOBs and into the filesystem, for a massive performance boost. This meant restructuring our disk and db sizing, since the vast majority of our db storage was tied up in those BLOBs. After months of dev and careful testing, it was ready to go.
It was my crowning achievement on my first big programming job, a massive mark on the system. And it was intended to be my last - I had taken an offer in another city. The first day of "production season" was my last day on the job I'd worked for four and a half years.
So when production started on Friday morning, the DBA noticed something bad - the databases were filling far faster than expected. Like, "We are going to run out of space in four hours" kind of faster. The space was supposed to be enough to last for three months, with room to spare! Oops.
So instead of spending my last day saying goodbye to all my friends and colleagues, I spend it in a blind panic, trying to figure out what the hell is happening? I'd tested so thoroughly!
But my tests were tiny in scale compared to the scope of the system in production. One scanner running for an hour or so is nothing, compared to twenty of them running 24/7. I couldn't even begin to dent the db size, even with the apparent bug. I missed something.
After a few hours of panic, I found the bug. It was a latent bug dating to the very beginning of the system, caused by the difference between NULL and 0 in a C pointer. You say there's no difference? Well, allow me to retort! The Sybase db library would, given a BLOB column in a table, automatically allocate 8k of space for it if you passed in a 0 pointer for content, but would not allocate if you passed in NULL. Right there in one of the thirty-odd excellent Sybase paper manuals (they really were excellent), if you read it. It never showed before then, because those 8k allocations were swamped by the size of the real images being inserted in most rows.
That was a remarkable day.
And in the end, I feel vindicated, too. I had argued strenuously to remove the BLOB column completely, but the DBA (a cautious fellow) resisted, because he wasn't sure what other impact that might cause in other code. Lava Flow antipattern, right there. If we'd removed the column completely, as I suggested, the bug would never have occurred.