Live data from Hacker News

Jepsen: Amazon RDS for PostgreSQL 17.4

jepsen.io

81–90 of 153 posts

Re: Jepsen: Amazon RDS for PostgreSQL 17.4

#81
post #3

The submitted title buries the lede: RDS for PostgreSQL 17.4 does not properly implement snapshot isolation.

I emailed the mods and asked them to change it to this phrase copy-pasted from the linked article: > Amazon RDS for PostgreSQL multi-AZ clusters violate Snapshot Isolation

(The mods replied above; thank you!)

Re: Jepsen: Amazon RDS for PostgreSQL 17.4

#83
post #5

This is in such a thick academic style that it is difficult to follow what the problem actually might be and how it would impact someone. This style of writing serves mostly to remind me that I am not a part of the world that writes like this, which makes me a little sad.

Have you tried using an LLM? I’ve found good results getting at the underlying concepts and building a mental model that works for me that way. It makes domain expertise - that often has unique terminology for concepts you already know or at least know without a specific name - more easily accessible after a little bit of a QA round.

Lots of downvotes with no actual explanation of what the issue is my suggestion.

I’ve repeatedly used ChatGPT and Claude to help me understand papers and to cut through the verbiage to the underlying concepts.

Re: Jepsen: Amazon RDS for PostgreSQL 17.4

#84
It's not mentioned in the headline and not made super clear in the article: This is specific to multi-AZ clusters, which is a relatively new feature of RDS, and differ from multi-AZ instance that most will be familiar with. (Clear as mud.)

Multi-AZ instances is a long-standing feature of RDS where the primary DB is synchronously replicated to a secondary DB in another AZ. On failure of the primary, RDS fails over to the secondary.

Multi-AZ clusters has two secondaries, and transactions are synchronously replicated to at least one of them. This is more robust than multi-AZ instances if a secondary fails or is degraded. It also allows read-only access to the secondaries.

Multi-AZ clusters no doubt have more "magic" under the hood, as its not a vanilla Postgres feature as far as I'm aware. I imagine this is why it's failing the Jepsen test.

Re: Jepsen: Amazon RDS for PostgreSQL 17.4

#86
post #84

It's not mentioned in the headline and not made super clear in the article: This is specific to multi-AZ clusters, which is a relatively new feature of RDS, and differ from multi-AZ instance that most will be familiar with. (Clear as mud.) Multi-AZ instances is a long-standing feature of RDS where the primary DB is synchronously replicated to a secondary DB in another AZ. On failure of the primary, RDS fails over to…

Have one question

So if snapshot violation is happening inside Multi-AZ instances, it can happen with a single region - multiple read replica kind of setup as well ? But it might be easily observable in Multi-AZ setups because the lag is high ?

Re: Jepsen: Amazon RDS for PostgreSQL 17.4

#87
post #77

Interesting. At a previous company, when we changed the pg_dump command in a backup script to start using parallel workers (-j flag) we started to rarely see errors that suggested inconsistency when restoring the backups (duplicate key errors and fk constraint errors). At the time, I tried reporting the issue to both AWS and on the Postgres mailing list but never got anywhere since I could not easily reproduce it. We…

Was a single instance, one instance with a standby in another AZ or a multiaz cluster as tested here?

We saw it when we ran the pg_dump off a standby instance (or a "replica" to use RDS terminology). Our primary was a multi-az instance. So not exactly what they tested here I guess, but it makes me wonder what changes, if any, they've made to postgres under the hood.

Re: Jepsen: Amazon RDS for PostgreSQL 17.4

#89
post #15

It's not entirely clear but this isn't an issue in multi instance upstream Postgres clusters? Am I correct in understanding either AWS is doing something with the cluster configuration or has added some patches that introduce this behavior?

What are multi instance upstream Postgres clusters for you? PostgreSQL has no official support for failover of a master instance, the only mechanism is Postgres replication which you can make synchronous. Then you can build your own tooling around this to build a Postgres cluster (Patroni is one such tool).

AWS patched Postgres to replicate to two instances and to call it good if one of the two acknowledges the change. When this ack happens is not public information.

My personal opinion is that filesystem level replication (think drbd) is the better approach for PostgreSQL. I believe that this is what the old school AWS Multi-AZ instances do. But you get lower throughput and you can't read from the secondary instance.

Re: Jepsen: Amazon RDS for PostgreSQL 17.4

#90
post #88
post #55

I wonder how Aurora fares on this?

I wondered how Microsoft SQL Server fares, but not it's tested in the long list of databases: https://jepsen.io/analyses

It may violate the SQL Server license? Microsoft have not apparently paid for a Jepsen analysis (or perhaps don't want it public :))
Post reply on HN