TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Jepsen: MongoDB 4.2.6

604 pointsby aphyralmost 5 years ago

25 comments

dangalmost 5 years ago
All: there was a big thread about this yesterday (<a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23285249" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23285249</a>) but because it didn&#x27;t focus on the technical content, and because there were glitches with a previous submission of this report (described at <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23288120" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23288120</a> and <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23287763" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23287763</a> if anyone cares), we invited aphyr to repost this. Normally we downweight follow-up posts that have such close overlap with a recent discussion (<a href="https:&#x2F;&#x2F;hn.algolia.com&#x2F;?dateRange=all&amp;page=0&amp;prefix=true&amp;query=by%3Adang%20follow-up&amp;sort=byDate&amp;type=comment" rel="nofollow">https:&#x2F;&#x2F;hn.algolia.com&#x2F;?dateRange=all&amp;page=0&amp;prefix=true&amp;que...</a>), so the exception is probably worth explaining.
ingloralmost 5 years ago
I also want to point their Node.js transactions API is wrong and looks like they have no idea how promises or async code work in JS.<p>In mongo, you have a `withTransaction(fn)` helper that passes a session parameter. Mongo can call this function mutliple times with the same session object.<p>This means that if you have an async function with reference to a session and a transaction gets retried - you very often get &quot;part of one attempt + some parts of another&quot; committed.<p>We had to write a ton of logic around their poor implementation and I was shocked to see the code underneath.<p>It was just such a stark contrast to products that I worked with before that generally &quot;just worked&quot; like postgres, elasticsearch or redis. Even tools people joke about a lot like mysql never gave me this sort of data corruption.<p>Edit: I was kind of angry when writing this so I didn&#x27;t provide a source and I&#x27;m a bit surprised this go so many upvotes without a source (I guess this community is more trusting than I assumed :] ). Anyway for good measure and to behave the way I&#x27;d like others to when making such accusations here is where they pass the same session object to the transacton <a href="https:&#x2F;&#x2F;github.com&#x2F;mongodb&#x2F;node-mongodb-native&#x2F;blob&#x2F;e5b762c6d53afa967f24c26a1d1b6c921757c9c9&#x2F;lib&#x2F;sessions.js#L376" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mongodb&#x2F;node-mongodb-native&#x2F;blob&#x2F;e5b762c6...</a> (follow from withTransaction in that file) - I can add examples of code easily introducing the above mentioned bug if people are interested.
评论 #23291361 未加载
评论 #23293053 未加载
评论 #23291949 未加载
评论 #23292133 未加载
评论 #23293245 未加载
评论 #23293147 未加载
评论 #23292043 未加载
评论 #23291982 未加载
评论 #23296667 未加载
aphyralmost 5 years ago
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&#x27;m happy to answer as best I can.
评论 #23291800 未加载
评论 #23292105 未加载
评论 #23291115 未加载
评论 #23290969 未加载
评论 #23294267 未加载
评论 #23291311 未加载
评论 #23291303 未加载
评论 #23293885 未加载
评论 #23293695 未加载
评论 #23292862 未加载
lllr_fingeralmost 5 years ago
Mongo has been <i>related to</i> &quot;perpetual irritation&quot; up to &quot;major production issue&quot; at all three of my last companies.<p>For as easy as it is to use jsonb in Postgres, or Redis, or RocksDB&#x2F;SQLite, or whatever else depending on your use case - I can&#x27;t find any reason to advocate its use these days. In my anecdotal experience, the success stories never happen, and nearly developer I know has an unpleasant experience they can share.<p>Big thanks to aphyr and the Jepsen suite (and unrelated blog posts like Hexing the Interview) for inspiring me to do thorough engineering.
评论 #23291184 未加载
评论 #23291628 未加载
评论 #23291226 未加载
mtrycz2almost 5 years ago
aphyr, you are of great inspiration as an engineer and as a human.<p>Your attitude of &quot;a tool I need doesn&#x27;t exists, so I&#x27;ll just go ahead and create it&quot; blew my mind and changed me for the better.<p>I&#x27;m dedicating my next test framework to you. Thank you for everything.
评论 #23291084 未加载
评论 #23296133 未加载
chousukealmost 5 years ago
This article reinforces my stance that bad defaults are a bug. Defaults should be set up with the least number of pitfalls and safety tradeoffs possible so that the system is as robust as it can be for the majority of its users, since the vast majority of them aren&#x27;t going to change the defaults.<p>Sometimes you end up with bad defaults simply by accident but I feel like for MongoDB the morally correct choice would be to own up to past mistakes and change the defaults rather than maintain a dangerous status quo for &quot;backwards compatibility&quot;, even if you end up looking worse in benchmarks as a result.
评论 #23295195 未加载
zzzeekalmost 5 years ago
How many more years do we have to keep evaluating, studying, and reading about MongoDB&#x27;s ongoing failures? It would appear this product has been a great burden on the community for many years.
评论 #23292263 未加载
bithavocalmost 5 years ago
&gt; Clients observed a monotonically growing list of elements until [1 2 3 5 4 6 7], at which point the list reset to [], and started afresh with [8]. This could be an example of MongoDB rollbacks, which is a fancy way of saying “data loss”.<p>I hope they learned the lesson, don&#x27;t fuck with aphyr.
评论 #23291262 未加载
junonalmost 5 years ago
I wanted to incorporate MongoDB into a C++ server at one point.<p>Their C&#x2F;C++ client is literally unusable. I went to look into writing my own that actually worked and their network protocols are almost impossible to understand. BSON is a wreck and basically the whole thing discouraged me from ever trying to interact with that project again.
loegalmost 5 years ago
Aphyr is such a competent professional. What a relatively thorough and polite response to Mongo&#x27;s inaccurate claims. &quot;We also wish to thank MongoDB’s Maxime Beugnet for inspiration.&quot; is a nice touch.
egeozcanalmost 5 years ago
The general mood I observed about MongoDB was that it used to be inconsistent and unreliable but they fixed most, if not all of those problems and they now have a stable product but bad word of mouth among developers. Personally, I&#x27;ve treated it as &quot;legacy&quot; and migrated everything that I had to touch since 2013 [0], and luckily (just read the article so hindsight 20&#x2F;20 -- transaction running twice and seeing its own updates? holy...) never gave it another try.<p>[0]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6801970" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6801970</a> (BTW: no, my dream of simple migration never materialized, but exporting and dumping data to Postgres JSONB columns and rewriting queries turned out to be neither buggy nor hard).
评论 #23291168 未加载
judofyralmost 5 years ago
This is not directly related to this report or Jepsen, but since you&#x27;re here I&#x27;ve got to ask: Aphyr, are there any recent papers&#x2F;research in the realm of distributed databases which you&#x27;re excited about?
评论 #23291236 未加载
ingloralmost 5 years ago
Without going into details die to NDAs, the experience in the OP matches the ones of several fortune 500 companies I had gigs with.
nevi-mealmost 5 years ago
Friendly question: did you update anything on the findings since <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23191439" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23191439</a> ?
评论 #23290937 未加载
azernikalmost 5 years ago
Ouch. This is what you get when you order up a third-party review and then misrepresent it in advertising.
评论 #23294504 未加载
sam1ralmost 5 years ago
Extremely well written! I learned a lot.<p>I wonder if someone can type up a well-manicured post-Morten of the recent triple byte incident?
depralmost 5 years ago
&gt;Sometimes, Programs That Use Transactions… Are Worse<p>I understood that reference
rmdashrfstaralmost 5 years ago
The main argument for using a documented-oriented database: <a href="https:&#x2F;&#x2F;martinfowler.com&#x2F;bliki&#x2F;AggregateOrientedDatabase.html" rel="nofollow">https:&#x2F;&#x2F;martinfowler.com&#x2F;bliki&#x2F;AggregateOrientedDatabase.htm...</a>
sorokodalmost 5 years ago
I suppose there are reasons why the defaults are the way they are. Can anyone comment on the implications, performance or otherwise, of bumping up the read&#x2F;write concerns?
评论 #23291060 未加载
评论 #23291080 未加载
bbulkowalmost 5 years ago
mongodb&#x27;s business model, forever, has been to get developers to write code, be damned the fact that you can&#x27;t support it reliably on a cloudy day.
jtdevalmost 5 years ago
Now do DynamoDB.
评论 #23292267 未加载
tester756almost 5 years ago
Why is this being here everyday for last 3 days?
fastballalmost 5 years ago
At this point I think we might be going a bit overboard with title changes.<p>Now that it&#x27;s just &quot;MongoDB 4.2.6&quot;, the title makes me think that this is a release announcement, not an analysis of the software.<p>The first title (that specifically referenced a finding of the analysis) was best, imo. Mildly opinionated or whatever, but at least it quickly communicated the gist of the post. On the other hand:<p>&quot;Jepsen: MongoDB 4.2.6&quot; – not super helpful if you&#x27;re not already familiar with the Jepsen body of work.<p>&quot;MongoDB 4.2.6&quot; – as stated above, sounds like a release announcement.<p>If you want a suggestion, maybe something like &quot;Jepsen evaluation of MongoDB 4.2.6&quot;? Not overly specific (&#x2F; negative) like the first title, but at least provides some slight amount of context.<p>@dang
评论 #23292953 未加载
评论 #23292482 未加载
评论 #23292402 未加载
评论 #23292384 未加载
pier25almost 5 years ago
&gt; Normally we downweight follow-up posts<p>So you manually moderate the content?
评论 #23294537 未加载
评论 #23294867 未加载
评论 #23294679 未加载
评论 #23294619 未加载
评论 #23294686 未加载
lmilcinalmost 5 years ago
I am tech lead for a project that revolves around multiple terabytes of trading data for one of top ten largest banks in the world. My team has three, 3-node, 3TB per node MongoDB clusters where we keep huge amount of documents (mostly immutable 1kB to 10kB in size).<p>Majority write&#x2F;read concern is exactly so that you don&#x27;t loose data and don&#x27;t observe stuff that is going to be rolled back. It is important to understand this fact when you evaluate MongoDB for your solution. That it comes with additional downsides is hardly a surprise, otherwise there would be no reason to specify anything else than majority.<p>You just can&#x27;t test lower levels of guarantees and then complain you did not get what higher levels of guarantees were designed to provide.<p>It is also obvious, when you use majority concern, that some of the nodes may accept the write but then have to roll back when the majority cannot acknowledge the write. It is obvious this may cause some of the writes to fail that would succeed should the write concern be configured to not require majority acknowledgment.<p>The article simply misses the mark by trying to create sensation where there is none to be found.<p>The MongoDB documentation explains the architecture and guarantees provided by MongoDB enough so that you should be able to understand various read&#x2F;write concerns and that anything below majority does not guarantee much. This is a tradeoff which you are allowed to make provided you understand the consequences.
评论 #23291249 未加载
评论 #23291433 未加载
评论 #23291330 未加载
评论 #23294304 未加载