HNHacker News
TopNewBestAskShowJobs

aphyr

9,565 karma · joined January 15, 2010

https://aphyr.com

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

submissionscomments
aphyr··on Jepsen: MongoDB 4.2.6
> I did not find any proof of this in the rest of the report.

May I suggest sections 3.4, 3.5, 3.6, 3.7, 4.0, and 4.1?

aphyr··on Jepsen: MongoDB 4.2.6
Possibly! You're right that path dependence played a role in safety issues: the problems we found in 3.4.0-rc3 were related to grafting the new v1 replication protocol onto a system which made assumptions about how v0 behaved. That said, I don't want to discount that MongoDB has made significant improvements over the years. Single-document linearizability was a long time in the works, and that's nothing to sneeze at!

http://jepsen.io/analyses/mongodb-3-4-0-rc3

aphyr··on Jepsen: MongoDB 4.2.6
No, I haven't! You can see a full list of analyses here: http://jepsen.io/analyses
aphyr··on Jepsen: MongoDB 4.2.6
I was lucky to have a good education: my B.A. involved courses in contemporary experimental physics and independent research in nonlinear quantum dynamics (esp. proofs, experimental design, writing), cognitive and social psychology (more experiment design and stats), math structures (proof techniques), philosophy (metaphysics, philosophy of science), and English (rhetoric). All of those helped give me a foundation for doing this kind of experimental work and communicating it to others.

Jepsen draws inspiration from a long line of work on property-based testing, especially Quickcheck & co. It also draws on roughly 10 years of experience building & running distributed systems in production. A lot of Jepsen I invented from whole cloth, but some of the checkers in Jepsen are derived from specific research papers, like work by Wing, Gong, and Howe on linearizability checking.

Then it's just... a lot of thinking, experimenting, and writing. Jepsen's the product of ~6 years of full-time work. Elle, the system which detected the anomalies in this report, was a research project I've been puzzling over for roughly two years.

I write the Jepsen series, and open-source all of the code for these tests, partly as a resource so that other people can learn to do this same kind of work. :-)

aphyr··on Jepsen: MongoDB 4.2.6
You just can't test lower levels of guarantees and then complain you did not get what higher levels of guarantees were designed to provide.

Gently, may I suggest that you read the report, or at least the abstract? This is addressed in the second sentence. :-)

aphyr··on Jepsen: MongoDB 4.2.6
Calvin and CRDTs aren't new, but I still think they're dramatically underappreciated! Heidi Howard's recent work on generalizing Paxos quorums is super intriguing, and from some discussion with her, 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.

I'm also excited about my own research with Elle, but we're still working on getting that through peer review, haha. ;-)

aphyr··on Jepsen: MongoDB 4.2.6
There's a few things at play here. One is talking only about the positive results from the previous Jepsen analysis, while not discussing the negative ones. Vendors often try to represent findings in the most positive light, but this was a particularly extreme case. Not discussing default behavior is a significant oversight, and it's especially important given ~80% of people run with default write concern, and 99% run with default read concern.

The middle part of the report talks about unexpected but (almost all) documented behavior around read and write concern for transactions. I don't want to conjecture too much about motivations here, but based on my professional experience with a few dozen databases, and surveys of colleagues, I termed it "surprising". The fact that there's explicit documentation for what I'd consider Counterintuitive API Design suggests that this is something MongoDB engineers considered, and possibly debated, internally.

The final part of the report talks about what I'm pretty sure are bugs. I'm strongly suspicious of the retry mechanism: it's possible that an idempotency token doesn't exist, isn't properly used, or that MongoDB's client or server layers are improperly interpreting an indeterminate failure as a determinate one. It seems possible that all 4 phenomena we observed stem from the retry mechanism, but as discussed in the report, it's not entirely clear that's the case.

aphyr··on Jepsen: MongoDB 4.2.6
Aw shucks, thank you! <3
aphyr··on Jepsen: MongoDB 4.2.6
Latency is a big one--you've got to wait an extra round-trip for secondaries to acknowledge primary writes, and primaries (assuming you don't have reliable clocks) need to check in with secondaries to confirm they have the most recent picture of things if you want to do a linearizable read. Snapshot isolated reads shouldn't require that, at least in theory--it's legal to read state from the past under SI, so there's no need to establish present leadership. That's why I'm surprised that MongoDB requires snapshot reads to go through write concern majority--it doesn't seem like it'd be necessary. Might have something to do with sharding--maybe establishing a consistent cut across shards requires a round of coordination. Even then I feel like that's a cost you should be able to pay only at write time, making reads fast, but... apparently not! I'm sure the MongoDB engineers who designed this system have good reasons; they're smart folks and understand the replication protocol much better than I do.

MongoDB's also published a writeup (which is cited a few times in the Jepsen report!) talking about the impact of stronger safety settings and why they choose weak defaults: http://www.vldb.org/pvldb/vol12/p2071-schultz.pdf

aphyr··on Jepsen: MongoDB 4.2.6
Yeah, there's no workaround that I can find for 3.4 (duplicate effects), 3.5 (read skew), 3.6 (cyclic information flow), or 3.7 (read own future writes). I've arranged those in "increasingly worrying order"--duplicating writes doesn't feel as bad as allowing transactions to mutually observe each other's effects, for example. The fact that you can't even rely on a single transactions' operations taking place (or, more precisely, appearing to take place) in the order they're written is especially worrying. All of these behaviors occurred with read and write concerns set to snapshot/majority.

That's not to say that workarounds don't exist, just that I didn't find any in the documentation or by twiddling config flags in the ~2 weeks I was working on this report. :)

aphyr··on Jepsen: MongoDB 4.2.6
Hi folks! Author of the report here. If anyone has questions about detecting transactional anomalies, what those anomalies are in the first place, snapshot isolation, etc., I'm happy to answer as best I can.
aphyr··on Jepsen: MongoDB 4.2.6
Nope! Something weird happened to that post; it got a lot of upvotes and some comments, but never made it to frontpage. After the InfoQ article took off yesterday, an HN mod got in touch and asked if I'd like to resubmit it.
aphyr··on Jepsen Disputes MongoDB's Data Consistency Claims
It looks like relatively few people clicked through to read the analysis itself, so @dang's kindly offered to repost it. You can find the analysis here:

https://jepsen.io/analyses/mongodb-4.2.6

... and the corresponding HN thread here:

https://news.ycombinator.com/item?id=23290844

aphyr··on Jepsen: Dgraph 1.1.1
It sounds like you're asking for contract work; you're welcome to email me at aphyr@jepsen.io.
aphyr··on Jepsen: Dgraph 1.1.1
Sure, I could run Jepsen against anything I can talk to over the network, but a.) it might be painful or impossible to get a fresh, healthy cluster for each test run (It's... fairly common that databases stop being databases during a test) and b.) doing fault injection means I need a way to, well, inject faults. That's why Jepsen tests almost always involve Jepsen controlling the cluster.
aphyr··on Jepsen: Dgraph 1.1.1
>> graph traversal across different attributes might pay a higher latency cost

> Those can be done concurrently if at the same query level, so not necessarily any slower.

An important clarification, yes! I should have made that more explicit. :)

aphyr··on Jepsen: Dgraph 1.1.1
Kinda depends on what you're doing, how much of Jepsen you're using, and how complex the system-specific code is. You can write a minimal Jepsen test in ~100 lines of code, if that's helpful. Jepsen and its main supporting libraries (Elle and Knossos) clock in at about 19K lines of code; a little over six years of full-time work.

For simulation testing, I'd suggest looking at Maelstrom, which uses Jepsen to provide a sort of workbench for writing toy Raft implementations in any language. You give it a binary which takes messages as JSON on STDIN and emits messages to STDOUT; it spawns a bunch of "nodes" (local processes) of that binary, connects them via a simulated network, generates pathological network behavior, simulates client requests, and verifies the resulting histories with Jepsen.

https://github.com/jepsen-io/maelstrom

aphyr··on Jepsen: Dgraph 1.1.1
The first sentence is describing how Dgraph shards data for storage; the second sentence discusses how data can be represented in the query API. You're right that this could lead to broad fanout, if users typically retrieved all attributes for a given UID. It also impacts the performance of joins: graph traversal across a single attribute is much faster when all those edges are on the same node, but graph traversal across different attributes might pay a higher latency cost. This is a classic dilemma in distributed graph storage--does one shard by attribute? By entity? Each leads to distinct performance tradeoffs, and Dgraph happened to choose attribute sharding.

Also keep in mind that typical Dgraph workloads request specific attributes (think "SELECT NAME, AGE") rather than everything ("SELECT *"), which reduces the impact of fanout. :)

aphyr··on Jepsen: Dgraph 1.1.1
Yes: the library is prominently linked on the home page, and there are deep links to the Dgraph test suite code throughout the report. Pretty much all of my work is OSS, and public release of test harness for each report is explicitly part of the Jepsen ethics policy. :)

https://github.com/jepsen-io https://jepsen.io/ https://jepsen.io/ethics

aphyr··on Jepsen: Dgraph 1.1.1
Yep! Testing databases is my full time job. Vendors pay me for the work, and that means the Jepsen library, test harness for each database, and all the reports are free for everyone. :)
aphyr··on Elle: Inferring Isolation Anomalies from Experimental Observations
Ah, yes, thank you!
aphyr··on Elle: Inferring Isolation Anomalies from Experimental Observations
Good question!

Consider RandDB, a database which returns random values for reads. It is possible that with RandDB, we happen to get a history which looks, say, serializable. And indeed, the observed history might be equivalent to a serializable Adya history, even though the underlying system is clearly not. This is, however, an accident--and given sufficiently long histories, the probability that we fail to observe a violation decreases.

Another possibility is that a database can explode the state space by producing indeterminate results for transactions. Of course, a database that deliberately did this would be silly, because nobody wants (I assume!?) a database that throws errors constantly. But when indeterminacy does happen, it's possible that we might fail to resolve some underlying anomaly. For instance, say an indeterminate write transaction actually aborts internally, but we don't know it aborted. If a committed read sees that write, that's technically an aborted read, but Elle (or any external observer) wouldn't be able to tell, because we can't prove the original write transaction aborted.

Likewise, if a database happens to avoid returning reads for some writes, we can't say anything about what write orderings are illegal. In the case of list append, we have the nice property that any single read tells us the entire version history up to that read, so the fraction of the version order we can't infer is limited to some (hopefully) short series of writes in the last n seconds. If the database never returns a read, though, all bets are off!

aphyr··on Elle: Inferring Isolation Anomalies from Experimental Observations
Oh! I didn't expect this to show up here! Happy to answer questions, if folks have any.

While this is on frontpage, I'd like to ask: if anyone has experience with machine proofs, I'd appreciate your help in completing a formal proof of Elle's correctness. I've been teaching myself Isabelle/HOL in an attempt to formalize the proof sketch, and I have encoded most of the formalism and properties I care about, but actually proving lemmata has been... frustrating. Like, I burned hours one one lemma because it hinged on showing \forall x :: Nat, x \in N.

https://github.com/jepsen-io/elle/tree/master/proof

If you'd like to work on this, my email is aphyr@jepsen.io!

aphyr··on Jepsen: Etcd 3.4.3
Many do, and even large DBs can be accomodated by throwing terabytes of RAM at the problem, but etcd is fundamentally targeted at a different problem domain than a general-purpose database. Everything in etcd is represented by a single-threaded state machine, which is great for simplicity and correctness, but that comes with performance limitations.
aphyr··on Jepsen: Etcd 3.4.3
This is also one of the things I suggested that'd be nice to have in the etcd API, along with an AST for boolean operations over guard expressions, more flexible comparators etc. You can emulate these with a sequence of independent transactions, but it'd be nice if the micro-transaction system were a tad more general.
aphyr··on Jepsen: Etcd 3.4.3
> It's debatable these bugs would've existed if a Jepson pipeline had been consistently in use from the 0.4.x days.

I don't think it would have helped: the Jepsen tests I wrote in 2014 only checked single-key gets, puts, and CaS operations; the problems we found in this report were in watches and locks.

aphyr··on Distributed SQL vs. NewSQL
Y'all really should hire me at some point. I've been building out transactional analysis tooling for Jepsen that can help distinguish between exactly these cases. :-)
aphyr··on State Farm uses payment signature for HIPAA disclosure authorization
Restating this for folks in the comments who didn't read:

When I applied for a policy, my agent provided me with an electronic signature pad at payment time. I understood that I was providing my consent to apply for coverage, and to pay for that policy. I do contract review as a part of my job, and read legal language carefully before signing.

Just before I left the building, they provided me with a folder full of informational material--a bunch of ads for state farm services and disability coverage in general, some policy overviews, etc. I set it on the counter when I got home, and planned to read it later--work was incredibly busy that week.

It turned out that State Farm had applied my payment signature to additional forms without my knowledge: a HIPAA authorization form and consent for State Farm to draw my blood and test it for HIV. I was provided neither verbal nor written information prior to signing that I was agreeing to either of these terms. I was not given a chance to review these agreements prior to signing. I didn't ask to see them, because I didn't know they were even a thing.

State Farm started pulling my health records from my old doctors. One of them thought it looked sketchy, and called me to confirm. My reaction was something like "What the fuck". They emailed me a copy of the forms, and that was the first time I learned I'd "agreed" to disclose my health records. Sure enough, they were in the folder: buried behind the ads and policy information. If I'd flipped through the folder in full before walking out the door, I could have run back in and insisted they cancel the authorization.

I immediately called State Farm, informed them they did not have my consent, and demanded they destroy any records they'd obtained. They said they'd do that. I've been waiting for them to confirm they've destroyed those records since, uh... May, I guess. The folder's still on top of my desk; I've been meaning to follow up with a HIPAA complaint. Started getting the state regulatory bodies involved, but haven't finished that process.

I had a detailed conversation with my agent at State Farm where we talked about the importance of informed consent and presenting people with paperwork prior to signing. He actually told me that not only was this standard procedure, but that he didn't actually know how to get a copy of the forms to show to customers so they could review before signing: the workflow State Farm designed didn't actually produce forms until the signature was already in place.

I don't fault my agent specifically for this; I fault State Farm's training and workflow. My understanding from talking with state regulators is that I'd have to initiate a complaint specifically against my agent, which is less than ideal. I like him and I don't want to fuck up his business, and he didn't understand that contracts require a meeting of the minds. This is, IMO, a systemic problem requiring better training and software design, and those are both State Farm corporate issues.

aphyr··on State Farm uses payment signature for HIPAA disclosure authorization
<sigh> Again, if you read the thread, you would also know that I could not possibly have agreed to these terms, because I didn't know they existed.
aphyr··on State Farm uses payment signature for HIPAA disclosure authorization
As I stated in the immediately following tweet in the thread, I was not presented with those forms at signing time. I had no idea they existed or that my signature would be applied to them.
← PreviousPage 6 of 26Next →