HNHacker News
TopNewBestAskShowJobs

aphyr

9,731 karma · joined January 15, 2010

https://aphyr.com

Hacker, physics geek, clojurer, rubyist, aikidoist, photographer.

submissionscomments
aphyr··on Jepsen: PostgreSQL 12.3
Familiar. If you've read any of the literature on snapshot isolation or isolation levels in general (Berenson, Bernstein, Gray, Melton, O'Neil, O'Neil, Adya, Liskov, Fekete, Cerone, Bailis, Alvisi, Clement, Crooks, Pu...) you would probably not expect to see SI treated as stronger than RR. The paper which first defined SI says it's not. Heck, Jim Melton, who wrote that part of the ANSI spec, is a co-author on that paper, which goes on to say the strict interpretation is incorrect and not what ANSI intended!
aphyr··on Jepsen: PostgreSQL 12.3
But in the meantime, given the choice of phantom reads or G2-item, I think I'd pick blocking phantom reads.

Well... it's not quite so straightforward. SI still allows some phantoms. It only prohibits some of them.

In PostgreSQL's case, if they somehow made repeatable read to prevent G2-item without sacrificing the phantom reads, would that mean repeatable read is then "serializable" according to the ANSI definition?

I'm not quite sure I follow--If you're asking whether snapshot isolation (Postgres "Repeatable Read") plus preventing G2-item is serializable, the answer is no--that model would still allow G2 in general--specifically, cycles involving non-adjacent rw dependencies with predicates.

aphyr··on Jepsen: PostgreSQL 12.3
No, Jepsen is over, sorry!

Jokes aside, Marklogic is welcome to pay me. Each one of these reports takes weeks to months of full-time work.

aphyr··on Jepsen: PostgreSQL 12.3
I hear occasional rumors, but nobody's published.
aphyr··on Jepsen: PostgreSQL 12.3
The report talks at length about this, but maybe it bears rephrasing!

The ANSI definitions are bad: they allow multiple interpretations with varying results. 25 years ago, Berenson, O'Neil, et al. published a paper showing the ANSI definitions had this ambiguity, and that what the spec meant to define should have been a broader class of anomalies. They literally say that the broad interpretation is the "correct" one, and the research community basically went "oh, yeah, you're right". Adya followed up with generalized isolation level definitions, and pretty much every paper I've read has gone with these versions since. That didn't make its way back into the SQL spec though: it's still ambiguous, which means you can interpret RR as allowing G2-item.

Why prevent G2-item in RR? Because then the difference between repeatable read and serializable is specifically phantoms, rather than phantoms plus... some other hard-to-describe anomalies. If you use the broad/generalized interpretation, you can trust that a program which only accesses data by primary key, running under repeatable read, is actually serializable. That's a powerful, intuitive constraint. If you use the strict interpretation, RR allows Other Weird Behaviors, and it's harder to prove an execution is correct.

For a very thorough discussion of this, see either Berenson or Adya's papers, linked throughout the report.

aphyr··on Jepsen: PostgreSQL 12.3
It's like HN is trying to get me in legal trouble today. Y'all are exhausting. Stop.
aphyr··on Jepsen: PostgreSQL 12.3
I don't use it often. In general, I've found the number of bugs I catch with core.typed doesn't justify the time investment in convincing things to typecheck--my tests generally (not always, of course!) find type issues first. I also tend to do a lot of weird performance-oriented stateful stuff with java interop, which brings me into untyped corners of the library.

That said, I've found core.typed helpful in managing complex state transformations, especially in namespaces which have, say, five or six similar representations of the same logical thing. What do you do when a "node" is a hostname, a logical identifier in Jepsen, an identifier in the database itself, a UID, and a UID+signature pair? Managing those names can be tricky, and having a type system really helps.

aphyr··on Jepsen: PostgreSQL 12.3
I think so, yeah. You could theoretically have a G2-item anomaly on a single key, but in PostgreSQL's case, the usual write-set conflict checking seems to prevent them.
aphyr··on Jepsen: PostgreSQL 12.3
Normally I'm a core.typed person, but static type constraints don't quite make sense here. We want heterogeneity in some cases (e.g. you want to be able to mix nils and ints), but not in others (e.g. this short and int mixing, which could be intentional, but also, might not be)

I've considered spec as well, but spec has a weird insistence that a keyword has exactly one meaning in a given namespace, which is emphatically not the case in pretty much any code I've tried to verify. Also its errors are... not exactly helpful.

aphyr··on Jepsen: PostgreSQL 12.3
Yeah, it was relatively infrequent in that particular workload--dramatically less than PostgreSQL's "repeatable read" exhibited. These histories are roughly 15K successful transactions long--see the stats field in results.edn. I'm hesitant to make strong statements about frequency, because I suspect this kind of thing depends strongly on workload, but I would hazard a gueesssss that it's not super common.
aphyr··on Jepsen: PostgreSQL 12.3
For legal reasons, Jepsen, the series on distributed database safety, has nothing to do with any other thing, place, person, or concept.
aphyr··on Jepsen: PostgreSQL 12.3
You can test pretty much any kind of concurrent system using Jepsen: in-memory data structures, filesystems, databases, queues, APIs, services, etc. Not all the tooling is applicable to every situation, but it's pretty darn general.
aphyr··on Jepsen: PostgreSQL 12.3
Er, again, the docs say "it is still possible to lose transactions even when using synchronous_mode_strict". I've talked about this with some of the Stolon folks on Twitter, and we're not exactly sure how that manifests--possibly an SI or SSI violation.
aphyr··on Jepsen: PostgreSQL 12.3
Yeah, the PostgreSQL team really knocked it out of the park on this one. It was a pleasure working with them. :)
aphyr··on Jepsen: PostgreSQL 12.3
Fun story: after the last report which called them out for not talking about write loss by default, MongoDB updated their Jepsen page to say that the analysis didn't observe lost writes. I guess they assumed that people wouldn't... read the abstract? Let alone the report?
aphyr··on Jepsen: PostgreSQL 12.3
Patroni's documentation also seems to suggest that even with the strongest settings, it can lose transactions; Stolon makes stronger claims.
aphyr··on Jepsen: PostgreSQL 12.3
I started this analysis intending to do just that--it's been difficult, however, to figure out which of the dozens of replication/HA configurations to actually test. I settled on Stolon, since it seemed to make the strongest safety claims. However, I found bugs which turned out to be PostgreSQL's fault, so I backed off to investigate those first.
aphyr··on Jepsen: PostgreSQL 12.3
Yes. Jepsen and Hypothesis both descend from a long line of property-based testing systems--mostly notably, Haskell & Erlang's QuickCheck. Jepsen makes a number of unusual choices specific to testing concurrent distributed systems: notably, we don't do much shrinking (real-world systems are staggeringly nondeterministic). Jepsen also includes tooling for automated deploys, fault injection, a language for specifying complex concurrent schedules, visualizations, storage, and an array of sophisticated property checkers.
aphyr··on Jepsen: MongoDB 4.2.6
I've actually written a little mini-Jepsen workbench for folks who want to practice implementing a distributed key-value store. Might be worth a spin! https://github.com/jepsen-io/maelstrom
aphyr··on Jepsen: MongoDB 4.2.6
I've invested seven years of my life into this brand, and my choices are carefully considered.
aphyr··on Jepsen: MongoDB 4.2.6
I'm not convinced it is false--IIRC their claim is specifically w.r.t other Kafka side effects, and those they can control.
aphyr··on Jepsen: MongoDB 4.2.6
I think this is a good way to look at things, and there are vendors who do this! VoltDB, for instance, changed their defaults to be strict serializable even though it imposed a performance hit, following their Jepsen analysis. https://www.voltdb.com/blog/2016/07/voltdb-6-4-passes-offici...
aphyr··on Jepsen: MongoDB 4.2.6
I'm kind of impressed any distributed system gets off the ground. These things are hard to write!
aphyr··on Jepsen: MongoDB 4.2.6
E.g. when each read should return the whole register's history the size of history grows O(n^2) compared to the case when the reads return just the head.

If you look at Elle's transaction generators, you can cap the size of any individual key, and use an uneven (e.g. exponential) distribution of key choices to get various frequencies. That way keys stay reasonably small (I use 1-10K writes/key), some keys are updated frequently to catch race conditions, and others last hundreds of seconds to catch long-lasting errors.

So I'm curios how would you have described the ability of finding violations with Elle using read-write registers with unique values vs the append-only lists?

RW registers are significantly weaker, though I don't know how to quantify the difference. I've still caught errors with registers, but the grounds for inferring anomalies are a.) less powerful and b.) can only be applied in certain circumstances--we talk about some of these details in the paper.

aphyr··on Jepsen: MongoDB 4.2.6
Not sure how many ways I can say this: the titles are already "Jepsen: X". HN's got a policy in place that means sometimes mods change the title to just "X". That's not something I have control over, sorry.
aphyr··on Jepsen: MongoDB 4.2.6
I think there are open possibilities in making leaderless single-round-trip consensus systems for log-oriented FSMs, which is what pretty much everyone WANTS.

This is based on her presentation and some dinner conversation at HPTS 2019, so I don't know if there's actually a paper I can point to. The gist of is that Paxos normally involves an arbitration phase where there are conflicting proposals, which adds a second pair of message delays. But if you relax the consensus problem to agreement on a set of proposals, rather than a single proposal, you don't need the arbitration phase. Instead of "who won", it becomes "everyone wins". Then you can impose an order on that set via, say, sorting, and iterate to get a replicated log.

I read over bits of Elle; the documentation in it is absolutely top-notch. You and Peter Alvaro knocked it out of the park!

Thank you! Could I... hang on, just let me grab reviewer #1 quickly, I'd like them to hear this. ;-)

aphyr··on Jepsen: MongoDB 4.2.6
Pretty much, yeah. There are some cases where Jepsen reaches into the guts of a database or lies to it via LD_PRELOAD shims, but generally these are Just Plain Old Binaries provided by vendors; no instrumentation required.
aphyr··on Jepsen: MongoDB 4.2.6
I'd like this too, but I'm not sure how to do fault injection against an Amazon-controlled service.
aphyr··on Jepsen: MongoDB 4.2.6
This... usually happens on Jepsen HN threads. The full title, as in the page metadata, and as originally submitted, is "Jepsen: MongoDB 4.2.6. At some point a mod drops the "Jepsen:" part, then we have this discussion, and it comes back. :)

"Why don't you put Jepsen:" on the same line as the database name and version?"

Space concerns, and also, it's immediately above the DB name in giant letters.

"Why don't you give them more creative names?"

Clients love to argue about the titles of these analyses; having a concise, predictable policy for titling is how I get past those discussions.

aphyr··on Jepsen: MongoDB 4.2.6
I'd like to, but I don't have any way to do fault injection on a system someone else owns. :(
← PreviousPage 5 of 27Next →