Live data from Hacker News

I Accidentally Deleted 7TB of Videos Before Going to Production

blog.thevinter.com

31–40 of 362 posts

Re: I Accidentally Deleted 7TB of Videos Before Going to Production

#31

[deleted]

You're right and I edited the company's name (might be too late but better this way). That said I'm not very happy with the experience of working for TheCompanyTM anyways so I'm in the process of switching jobs. Thanks for the comment :)

You're welcome and good luck!

Re: I Accidentally Deleted 7TB of Videos Before Going to Production

#33
post #16

Under NDA but I'll give rough details of what's occurring while also naming my client and disparaging them to the public. Well that's a brave move...

They said they are a junior developer with not much experience. I'm afraid they may not know what is and isn't covered under NDA.

My tip would be: read what you sign.

Re: I Accidentally Deleted 7TB of Videos Before Going to Production

#34
post #22

Earlier quoted context omitted.

Where do you see the clients name? I only see Vimeo being mentioned.

It has been edited. https://news.ycombinator.com/item?id=31271836

Got it. To be honest I'd be hesitant to publish a blog post like that with your name + current company name attached to it.

It's a bit different to share a fun story a few years later about that time you almost wiped production.

Re: I Accidentally Deleted 7TB of Videos Before Going to Production

#35
Honestly, this is positively representative of any junior developer with comparable experience. Depending on their background and how much production work they had, there's an overwhelming sense of eagerness and enthusiasm. Quick to script and perhaps a bit too quick to execute.

A friendly team will harness that enthusiasm and tame the quickness / encourage respect for production. We all made a massive doo doo and its how you proceed that'll define your career.

Re: I Accidentally Deleted 7TB of Videos Before Going to Production

#36
This is one of those times that even if you don’t use a fully functional language, trying to make as much of your program logic pure functions would be helpful.

It also makes it more testable. Instead of putting the delete call right in the loop, split it into four functions.

    function getAllVimeoVideos()

    function getAllDbVideos()

    function getVideosToDelete(vimeo_videos, db_videos)

    function deleteVideos(videos_to_delete)

Your core logic lives in getVideosToDelete which is simply a set difference.

Given that there are only a few hundred videos, it is easy to run the getter functions above and quickly verify they are returning what you expect.

Re: I Accidentally Deleted 7TB of Videos Before Going to Production

#37
post #4

> but at the time the code seemed completely correct to me It always does. > Well, it teaches me to do more diverse tests when doing destructive operations. Or add some logging and do a dry run and check the results, literally simple prints statements: print("-----") print("Downloading videos ids from url: {url}") print(list of ids) ... ... ... # delete() dangerous action commented out until I'm sure it's right print…

This is how I do it in compiled code. In shell, I print the destructive command for dry runs - no conditions around whether to print or not, I go back to remove echo and printf to actually run the commands.

Re: I Accidentally Deleted 7TB of Videos Before Going to Production

#38

[deleted]

You're right and I edited the company's name (might be too late but better this way). That said I'm not very happy with the experience of working for TheCompanyTM anyways so I'm in the process of switching jobs. Thanks for the comment :)

Talking bad about your employer is great for finding a new job. Companies are eager to hire people who bad-talk them.

Re: I Accidentally Deleted 7TB of Videos Before Going to Production

#39
post #4

> but at the time the code seemed completely correct to me It always does. > Well, it teaches me to do more diverse tests when doing destructive operations. Or add some logging and do a dry run and check the results, literally simple prints statements: print("-----") print("Downloading videos ids from url: {url}") print(list of ids) ... ... ... # delete() dangerous action commented out until I'm sure it's right print…

Rather than commenting it out, I suggest adding a --live-run flag to scripts and checking the output of --live-run=false (or omitted) before you run it "live."

Re: I Accidentally Deleted 7TB of Videos Before Going to Production

#40
I like these stories. I think they resonate well for 'the rest of us'. I've made plenty of mistakes like this - you learn and grow, right?

One of the best things about HN is that so many incredible, talented people post. It's incredibly inspiring to raise your own game, to see what the best are doing. But sometimes it's equally important to realise we all fuck up, and for every unicorn dev there's another thousand of us grinding away.

OP - well done for sorting the problem and telling us all about it!

Post reply on HN