Earlier quoted context omitted.
This implies that their production environment is mutable. As in, a command can run and change the production environment. That’s a no no. But I give them a pass because they are a young company. My company was similarly reckless early on, but as we scaled, we had to tighten things up and turning to an immutable deployment approach has saved our asses so many times.
Is being a young company really an excuse when any half-decent engineer knows these things are bad? Being a young company doesn't mean you ignore all the mistakes other people have made and figure them out for yourself. I really surprised someone has access to the prod DB, and that it's possible for them to connect to it in dev (Meaning they have a copy of the credentials???).
Incident report for February 21st, 2024
51–60 of 65 posts
Re: Incident report for February 21st, 2024
#52"While building a feature, we performed a database migration command locally, but it incorrectly pointed to the production environment instead, which dropped all tables in production." This was scary.
That single sentence contains multitudes: * Production should be immutable * No one doing dev in a dev environment should have such trivial access to prod * Are there still good reasons for a migration to drop all tables? I guess it's for the dev environment to etch-a-sketch to a known state? Yikes.
We can restore a 10TB disk in about 12 minutes. its much faster to snapshot, do migration, then if necessary, drop disk and remake from snapshot. (and then replay the replay any other WAL changes up to the exact second you want with a tool like barman, wall-e, pg_backreset, etc.
Postgresql backups are critical for disaster recovery, but the restores are so very, very slow, they should be a last resort.
Re: Incident report for February 21st, 2024
#53This sounds like one of those horrible tools like prisma which drop everything if something is not in sync on dev. We removed this type of stupid in favour of our own which, you know, fixes this actually instead of lazily dropping everything when they cannot resolve some trivial thing, for instance, a new required field without default when there are already rows and other crap which they call ‘opinionated’. No idea…
The commands that suggest a reset are explicitly designed for use with development databases, not with production. The "deploy migrations to production database" command on the other hand only applies already existing migration files (that you have reviewed before) and does not suggest a reset, ever.
Re: Incident report for February 21st, 2024
#54Unfortunately these sort of mistakes are seen as a "right of passage" for many developers. I ran "`DELETE FROM users;` without a WHERE clause against production in my first year on the job. I felt absolutely terrible. I thought I was connected to a development machine. Fortunately we had backups available. Often this isn't a problem with the individual developer itself, but points to a problem with the organization.…
I think you mean 'rite of passage'
Re: Incident report for February 21st, 2024
#55Earlier quoted context omitted.
Or just use https://www.snaplet.dev
Unclear how that would have helped.
Does that make sense?
Re: Incident report for February 21st, 2024
#56Unfortunately these sort of mistakes are seen as a "right of passage" for many developers. I ran "`DELETE FROM users;` without a WHERE clause against production in my first year on the job. I felt absolutely terrible. I thought I was connected to a development machine. Fortunately we had backups available. Often this isn't a problem with the individual developer itself, but points to a problem with the organization.…
We are also building Bytebase, which enforces the change review process for such operations
Re: Incident report for February 21st, 2024
#57Earlier quoted context omitted.
Someone writes the migration, commits it, it passes the build and unit test stages of the pipeline, then the application as currently running passes all function and integration tests with (and this is important) both the prior and the revised schema. Your commit is tagged as release ready! Not long after, the automation tooling confidently executes the now-tested migration under machine control during the next deplo…
> Someone writes the migration, commits it, it passes the build and unit test stages of the pipeline, then the application as currently running passes all function and integration tests with (and this is important) both the prior and the revised schema. Your commit is tagged as release ready! Not long after, the automation tooling confidently executes the now-tested migration under machine control during the next dep…
Re: Incident report for February 21st, 2024
#58Unfortunately these sort of mistakes are seen as a "right of passage" for many developers. I ran "`DELETE FROM users;` without a WHERE clause against production in my first year on the job. I felt absolutely terrible. I thought I was connected to a development machine. Fortunately we had backups available. Often this isn't a problem with the individual developer itself, but points to a problem with the organization.…
We are also building Bytebase, which enforces the change review process for such operations
Re: Incident report for February 21st, 2024
#59Earlier quoted context omitted.
Unclear how that would have helped.
My assumption is that they connected to production to run their local environment against production to debug something. They needed the data. Snaplet can capture a small subset of data related to a particular user, and remove the private information, which they can restore on their local machine. Does that make sense?
I mean, I know there are some bad practices out there - but connecting local dev environment to prod database server would be insane for any reason!
Re: Incident report for February 21st, 2024
#60What strikes me in the incident report they focus on failed migration, where the real issue is not planning or not testing for recovery if migration goes very wrong.
Even if backup recovery would take just 6 hours would it be acceptable ?