20 Matching Annotations
- May 2023
-
www.the-paper-trail.org www.the-paper-trail.org
-
A perhaps surprising result from the Gilbert paper is that no implementation of an atomic register in an asynchronous network can be available at all times, and consistent only when no messages are lost. This result depends upon the asynchronous network property, the idea being that it is impossible to tell if a message has been dropped and therefore a node cannot wait indefinitely for a response while still maintaining availability, however if it responds too early it might be inconsistent.
?
-
-
aphyr.com aphyr.com
-
Why is this? I think it might be because software engineering is a really permeable field. You can start out learning Rails, and in two years wind up running four distributed databases by accident. Not everyone chose or could afford formal education, or was lucky enough to have a curmudgeonly mentor, or happened to read the right academic papers or find the right blogs. Now they might be using Redis as a lock server, or storing financial information in MongoDB. Is this dangerous? I honestly don’t know. Depends on how they’re using the system.
程序员门槛低
-
You could do this as an application developer by setting every Redis node to be a primary, and writing a proxy layer which uses, say, consistent hashing and active anti-entropy to replicate writes between nodes. Take a look at Antirez’s own experiments in this direction. If you want a CP system, you could follow Datomic’s model and use immutable shared-structure values in Redis, combined with, say, Zookeeper for mutable state.
How to implement CP or AP on Redis
-
-
redis.io redis.io
-
In general Redis + Sentinel as a whole are an eventually consistent system where the merge function is last failover wins, and the data from old masters are discarded to replicate the data of the current master, so there is always a window for losing acknowledged writes. This is due to Redis asynchronous replication and the discarding nature of the "virtual" merge function of the system. Note that this is not a limitation of Sentinel itself, and if you orchestrate the failover with a strongly consistent replicated state machine, the same properties will still apply. There are only two ways to avoid losing acknowledged writes: Use synchronous replication (and a proper consensus algorithm to run a replicated state machine). Use an eventually consistent system where different versions of the same object can be merged.
summary
-
This means that the quorum can be used to tune Sentinel in two ways:
有两个quorum(odown, failover)的原因
-
However the quorum is only used to detect the failure. In order to actually perform a failover, one of the Sentinels need to be elected leader for the failover and be authorized to proceed. This only happens with the vote of the majority of the Sentinel processes.
why?
-
- Apr 2023
-
antirez.com antirez.com
-
So you can say, ok, Sentinel has a limited scope, but could you add a feature so that when the master feels in the minority it no longer accept writes? I don't think it's a good idea. What it means to be in the minority for a Redis master monitored by Sentinels (especially given that Redis and Sentinel are completely separated systems)?
不适合quorum
-
-
shipilev.net shipilev.net
-
Safe Publication and Safe Initialization idioms are great abstractions over Java Memory Model rules. Used carefully, these idioms can be used as building blocks for constructing larger concurrent programs without breaking correctness.
Conclusion
-
The caveat is apparent here: we can not easily drop the Singleton instance from memory. Even if we lose all the references to the factory, the VM still needs to retain the class and its static fields.
caveat
-
Holder is lying to us: even though we instantiate a HolderFactory, the singleton is already initialized, and just sits there in a static field. The performance data for this idiom is unreliable.
为什么不准确?
Tags
Annotators
URL
-
-
www.yegor256.com www.yegor256.com
-
For example, this is how the method Thread.sleep() is designed (taking a very primitive approach):
check the implementation
-
- Nov 2022
-
fullstackopen.com fullstackopen.com
-
摩根
专有名词不应该翻译
-
快递
typo
The express json-parser we took into use earlier is a so-called middleware.
-
空闲
typo: 幂等
idempotence
-
同位素
typo
Methods can also have the property of "idempotence" in that (aside from error or expiration issues) the side-effects of N > 0 identical requests is the same as for a single request. The methods GET, HEAD, PUT and DELETE share this property
-
空闲
typo: 幂等
idempotence
-
< i>npm test
typo
-
运行时间
typo: 运行时
JavaScript runtime
-
堆栈
typo: 栈
In this part our focus shifts towards the backend: that is, towards implementing functionality on the server side of the stack.
-
-
redis.io redis.io
-
It tries to acquire the lock in all the N instances sequentially
能并发请求吗?
-