Live data from Hacker News

Distributed Systems Shibboleths

jolynch.github.io

61–70 of 72 posts

Re: Distributed Systems Shibboleths

#61
I'm a newbie and a little confused. On one hand there are posts like this that claim exactly-once delivery and distributed locks are impossible. But on the other hand, if I look at the docs of a distributed database, say Apache Ignite, they will say that they have exactly-once delivery [1] and distributed locks [2]. So ... which is it?

[1] https://ignite.apache.org/docs/latest/key-value-api/continuo...

[2] https://ignite.apache.org/docs/latest/distributed-locks

Re: Distributed Systems Shibboleths

#62
post #59

I liked the article a lot. I prefer the term retryable to idempotent. If there's a failure in the first call, to be truly idempotent it should fail on the second. Retryable on the other hand is easier to argue about. Important thing is not the response but the end state of the system.

Idempotent means that repeating the same operation eventually stabilizes, not that Op^2 = Op. It combines retryability of failures with retryability of successes. Alternatively, idempotency applies to successful operations, orthogonal from error cases. Retryability doesn't help in the case of the (bad) operation "+1" which is not idempotent.

Idempotent means exactly Op^2 = Op. If you want a word that means those other things, go find another, this one has long been taken.

Re: Distributed Systems Shibboleths

#63
post #61

I'm a newbie and a little confused. On one hand there are posts like this that claim exactly-once delivery and distributed locks are impossible. But on the other hand, if I look at the docs of a distributed database, say Apache Ignite, they will say that they have exactly-once delivery [1] and distributed locks [2]. So ... which is it? [1] https://ignite.apache.org/docs/latest/key-value-api/continuo... [2] https://ig…

Software vendors lie. Even open source ones. In some cases they get REALLY close to the truth, but aren't forthcoming with that last 1% case where their statement becomes a lie.

If you want to see a ton of lies, go and start reading through all the Jepsen posts tearing down those dubious claims.

http://jepsen.io/analyses

Re: Distributed Systems Shibboleths

#64
post #61

I'm a newbie and a little confused. On one hand there are posts like this that claim exactly-once delivery and distributed locks are impossible. But on the other hand, if I look at the docs of a distributed database, say Apache Ignite, they will say that they have exactly-once delivery [1] and distributed locks [2]. So ... which is it? [1] https://ignite.apache.org/docs/latest/key-value-api/continuo... [2] https://ig…

This is exactly the kind of stuff I wrote this post about. The first (exactly once) is actually just at-least-once with deduplication based on a counter. To reliably process the events, however, you need to make your downstream idempotent as well. Think of it like your event processor might fail, so even if you only receive the message "once" if you can fail processing it you still have to think about retries. In my opinion it would be explicitly better for the event system to provide "at least once" and intentionally duplicate events on occasion to test your processors ability to handle duplicates.

The second (lock) is actually a lease fwict, and writing code in the locked body that assumes it will be truly mutually exclusive is pretty dangerous (see the linked post from Martin [1] for why).

[1] https://martin.kleppmann.com/2016/02/08/how-to-do-distribute...

Re: Distributed Systems Shibboleths

#65
post #26

Earlier quoted context omitted.

> a lease with an infinite timeout unless manually returned I would argue that "infinite timeout" is another negative shibboleth. every operation in a distributed system has some duration after which you can be 99.9% confident (or 99.9999%, or whatever threshold you want to pick) that it was lost to the void and will never return a result. in a robust distributed system, you want to pick a reasonable timeout value, a…

I agree; it's also one of the few issues I have with Linux (and possibly Unix generally). Zombie processes (dependent on some lock that will never clear) shouldn't be possible. At the very least abort (kill -9) should always be possible. Failure should always be an option; it should be the default assumption. All other order must be wrested from that chaos.

Zombie processes are already dead and aborted, there's nothing more a kill -9 would do to them.

The kernel retains minimal state about them because the system has made a promise to report that the process exited to its parent process, and the parent process hasn't gotten around to asking for that yet.

(Don't confuse zombies with uninterruptible I/O sleep, or buggy kernel workers.)

Re: Distributed Systems Shibboleths

#66

Earlier quoted context omitted.

Is there a ‘standard’ way to test the positive shibboleths for existence? I am not necessarily thinking just tests running as code. Although that would be nice.

I think it's basically pay Aphyr/Jepsen $mondoConsultingRates. :)

I wonder how much it actually is. I push back hard on anyone trying to bring in a distributed database that has not had a report released by Jepsen, but I wish there was the funding and/or capacity to release updated reports more often.

Re: Distributed Systems Shibboleths

#67
post #31
post #12

Earlier quoted context omitted.

I feel like the correct approach is accepting that determinacy is nonsensical in a world where time is relative and instead doubling down on nondeterministic (but predictable!) algorithms. This means leveraging concepts like commutativity and associativity to ensure predictability.

> nondeterministic (but predictable!) Huh? How could a nondeterministic algorithm be predictable? Do you mean algorithms with a nondeterministic but overall irrelevant component ("pick a random element from this set")?

A simple example is algorithms that compute the value of applying associative and commutative functions. For example we can sum a set of integers by nondeterministically picking and removing an element and iterating until the set is empty. Despite the large number of possible processes, the result at termination will always be the same.

Re: Distributed Systems Shibboleths

#68
post #26

Earlier quoted context omitted.

I agree; it's also one of the few issues I have with Linux (and possibly Unix generally). Zombie processes (dependent on some lock that will never clear) shouldn't be possible. At the very least abort (kill -9) should always be possible. Failure should always be an option; it should be the default assumption. All other order must be wrested from that chaos.

Zombie processes are already dead and aborted, there's nothing more a kill -9 would do to them. The kernel retains minimal state about them because the system has made a promise to report that the process exited to its parent process, and the parent process hasn't gotten around to asking for that yet. (Don't confuse zombies with uninterruptible I/O sleep, or buggy kernel workers.)

I might have done that last line, but I do mean generally. Even if it isn't kill -9 (which it should be, somehow, since that's the human's intent when they use it); there should be some mechanism for reaching the 'failed' state and the process itself leaving the accounting tables.

Stuck mounts have a half solution (lazy unmounts) but even _that_ interface really also needs a timeout value after which operations on the target should be assumed to fail rather than return correctly.

Offhand, I wonder if there's currently or previously been a DoS attack based on defunct uninterruptible sleep. Theoretically a system could be exhausted of PIDs which could lead to nasty issues.

Re: Distributed Systems Shibboleths

#69
post #68

Earlier quoted context omitted.

Zombie processes are already dead and aborted, there's nothing more a kill -9 would do to them. The kernel retains minimal state about them because the system has made a promise to report that the process exited to its parent process, and the parent process hasn't gotten around to asking for that yet. (Don't confuse zombies with uninterruptible I/O sleep, or buggy kernel workers.)

I might have done that last line, but I do mean generally. Even if it isn't kill -9 (which it should be, somehow, since that's the human's intent when they use it); there should be some mechanism for reaching the 'failed' state and the process itself leaving the accounting tables. Stuck mounts have a half solution (lazy unmounts) but even _that_ interface really also needs a timeout value after which operations on th…

> 'failed' state and the process itself leaving the accounting tables.

Once again, that cannot be done until the parent process consumes the exit status. That's what the zombie is there for. Zombies don't take up much space.

> Stuck mounts have a half solution (lazy unmounts) but even _that_ interface really also needs a timeout value after which operations on the target should be assumed to fail rather than return correctly.

These days most NFS etc mounts are "soft mounts", that is operations will eventually time out.

Lazy unmount doesn't really apply here, it makes the mountpoint disappear from the global namespace, but all existing open files remain untouched, and the mount lives as long as anything is still using it; it just removes the "entry point" to the mount.

On today's Linux, it's up to each filesystem to provide abort/timeout mechanism. For timeouts, this is the right design, as demonstrated by macOS complications with FUSE. I do wish there was a common way to make things abort.

There was a patch in circulation a long time ago, that could seamlessly switch all open FDs of any given mountpoint into a whole different filesystem named badfs. badfs would just return an error on any operation. As far as I know, that patch never got merged, probably because nobody ever got it working 100%.

That kind of a DoS would require a local attacker, and then the victim to access a mountpoint owned by the attacker. Using FUSE, you could get a lot of processes hanging like that, for sure. I guess you could trap a mail delivery agent, if you still had a system where mail was delivered to users' home directories.

However, forcibly aborting any FUSE mount is a single `echo 1 >/sys/fs/fuse/connection/NNNN/abort`, the only challenge is finding the right ID. (See https://github.com/bazil/fuse/blob/fb710f7dfd05053a3bc9516dd...)

Re: Distributed Systems Shibboleths

#70
post #13

> database vendors might try just a little harder to tell the truth... Come on, you know that's not what's going to happen. If they notice at all, they'll just incorporate the magic phrases into their BS so you have to hunt harder for a real signal.

Oh shoot I forgot Shibboleths have to remain secret, I have made a terrible mistake.

Indeed, you have doomed us all.

Less /s, I'd be more worried if I thought the salescritters were listening, but they're mostly not.

Post reply on HN