Backpressure in a distributed system allows receiving nodes to notify sending nodes that they temporarily lack the capacity to handle further requests. Without backpressure the receiving node must attempt to handle every request and, if overloaded, must shed load by returning error responses, often causing more work as the sender retries the failed requests.
Distributed systems must always be able to correctly deal with the non-delivery (or non-acknowledgement) of a message, but in any reasonable network environment one can assume that message non-delivery is fairly rare. This means we need not behave optimally in the case of a message non-delivery. In principle the system should still work correctly even if retransmissions were totally disabled, but…
Sometimes it’s useful to represent all the odd keys on a Mac OS keyboard with their proper glyphs in a textual conversation. There’s various ways to do that but honestly the easiest for me is just to search for a web page that contains the right glyphs and copy-paste them into the chat. Recently I’ve found that becoming less effective, requiring several different searches before finally finding a…
Bisection is a mightily effective technique for debugging those tricky issues that were quietly introduced into a codebase and not noticed for an extended period of time. You can find the first bad commit from a range of thousands (or more) in a logarithmic number of steps via a binary search, halving the range of possible bad commits on each step.
The Doomsday rule is an algorithm for working out the day of the week of a given date. It’s based on John Conway’s observation that certain memorable dates called doomsdays (4/4, 6/6, 8/8, 10/10, 12/12, 9/5, 5/9, 7/11, 11/7, …) always occur on the same day of the week in any given year. This day is known as the year’s anchor day. To compute an arbitary day of week you work out the anchor day for…
Back in August 2014 a user reported they couldn’t run Elasticsearch: it would immediately crash with a segmentation fault. Elasticsearch is almost entirely written in Java which as a managed language is supposed to protect us from low-level issues like segmentation faults. The “almost” in the previous sentence is the problem: Elasticsearch calls out to native code in a few places, and it was one…
If you are suffering from more than your fair share of silent corruption then you might have a buggy storage system. Here’s a couple of tools that exercise your storage with workloads that are simple and transparent whilst also being quite effective at triggering corruption bugs.
100% reliable data storage is fundamentally impossible, but we can get pretty close with layers of protection against something going wrong at the physical level. Databases are typically agnostic to the specific protections that any given installation is using and mostly just assume that the data they read from disk is the data they wrote there previously. The protections might be in the…
I sometimes have a need to collect a packet capture for an extended period of time. On a busy host this can generate enough data that it needs some special handling. In particular it’s useful to roll over to a new file every now and then, and to offload the completed files somewhere else so they don’t fill up the disk.
I recently came across a video from Zach Star which posed the question of telling the time on a clock whose two hands are identical lengths. This seems like a fairly well-known puzzle and it’s kinda entertaining to work out when you can and cannot tell the time on such a clock. Then I wondered what would happen if you added a second (i.e. third) hand which is also indistinguishable from the other…