Live data from Hacker News

The day I locked everyone out of the company intranet

dancowell.com

1–10 of 130 posts

Re: The day I locked everyone out of the company intranet

#4

Always do a select with your criteria before doing a Delete or update. Don’t ask me how I learned this.

Came here to say exactly that! I do a select count and then a limit against the returned count. At least it may reduce the blast radius.

Re: The day I locked everyone out of the company intranet

#5
I wrap all of my production manipulations in a transaction, and commit only if the results are expected. Yes, it may take locks that block customer-facing transactions, so I have selects ready to go in the transaction to minimise this.

15 years and counting since wiping out a large production table and taking a day to restore from backup.

Re: The day I locked everyone out of the company intranet

#9
post #8

In the top bar of the site: > Sorry! Subscriptions were broken last week, but are now working. If you tried to subscribe and ran into issues, please try again! I wonder if a similar incident involving a “UPDATE subscriptions” query happened recently.

Ha, no, that was a far more mundane issue. The CMS I'm using requires double opt-in to subscribe, meaning you need to enter your email address and click the confirmation link.

It also apparently requires double email configuration, meaning it has two places where you can configure your mailer. I had only set it up in one place, meaning the confirmations never got sent.

Bit of a facepalm moment.

Re: The day I locked everyone out of the company intranet

#10
post #6

Always do a select with your criteria before doing a Delete or update. Don’t ask me how I learned this.

>Don’t ask me how I learned this. Joke's on you, we all learned it this exact way.

This gives my heart pains I can't explain to my therapist..
Post reply on HN