Consistency

6 Consistency Guarantees Strong Consistency See all previous writes Eventual Consistency See (any) subset of previous writes Weakest Consistency Prefix See an ordered sequence of writes starting with the first write The read result exist at some point in the master Bounded Staleness See all “old” writes e.g. See all writes more than 5 minutes ago Monotonic Reads See increasing subset of writes Similar to eventual consistency Later read return more recently value Read my write See all writes performed by reader Strength of consistency guarantee Defined by the size of the set of allowable results Strong consistency Set size = 1 (only the latest value) Eventual Consistency Set size = large (any value) In-Class Linearizability Strong consistency, single copy All ops seen in same global order Global order determined by real time if a completes before b begins, a ordered before b else a + b are concurrent Simpler to reason about Poor performance Sequential Consistency All ops totally ordered but no real-time ordering linearizable w/o realtime Ops from one client are ordered in program order Causal Consistency No total order seen by all clients Causally-related ops: same order observed by all clients

April 1, 2022

Windows

Refresh password (RDP) runas /user:{user} cmd.exe

March 29, 2022

Byzantine

Sustain $\lfloor \frac{n-1}{3} \rfloor$ failures $f$ don’t response $f$ response but cannot tell if faulty node respond or not need $f$ + 1 to out number Provide safety and liveness Safety: all non faulty replicas agree on a total order for the execution of requests despite failures. System Model Network drop, delay, out of order, duplicate Faulty node behave arbitrarily Independent node failures $D(m)$ = digest of m $\langle m \rangle _{\sigma_i}$ = message sign by node $i$ Adversary can coordinate faulty nodes delay correct nodes cannot delay correct nodes indefinitely quantum compute Algorithm Terms replicas move through a succession of view primary of a view is $p = v \mod |R|$ $p$ primary replica $v$ view number $|R|$ total replicas $f$ max # to fail Replica = all servers Primary, Backup Process Client send request to primary primary multicasts all backups Replicas execute request and reply to client client wait for $f + 1$ same replies Client Client $c$ send $\langle REQUEST, o, t, c \rangle_{\sigma_c}$ to master $t$ timestamp $o$ operation to be executed Master broadcast to backups Replicas reply $\langle REPLY,v,t,c,i,r \rangle$ $r$ result $i$ replica number $v$ view number Client wait for $f + 1$ replies with same $t$ and $r$ If timeout Client broadcast request to all replica If already processed re-send reply (remember) If not processed & not primary redirect to primary Normal Case Replica state message log current view Three-phase atomic broadcast Pre-prepare Multicast to all backup and write to log $\langle \langle PRE-PREAPRE, v, n, d \rangle_{\sigma_p}, m \rangle$ $m$ is the client’s request (message)?...

March 29, 2022

WSL

interop WSL 會自動把 Windows Path 加到 Linux 的 Path 但很多 install script 會直接跑看看 node npm yarn cargo 確認你有沒有安裝 (e.g. Lunarvim 的 script) 他們就會吃到 Windows 的 Path 然後用 Windows 的 yarn 裝 dependency 然後就會發生神秘事件 可以關掉這功能,在 /etc/wsl.conf 加入 [interop] appendWindowsPath = false 可以把 explorer vscode 這種比較常用的東西加到 alias 例如: ~/.zshrc alias explorer="/mnt/c/Windows/explorer.exe" DNS 不知道為啥在 Windows host 開 VPN 的時候 WSL 的 DNS 就會壞掉 WSL2 , problem with network connection when VPN used (PulseSecure) · Issue #5068 · microsoft/WSL (github....

March 24, 2022

Tail Latency

很高的那些 Latency (? Ref Tail Latency Might Matter More Than You Think - Marc’s Blog (brooker.co.za) Why you should measure tail latencies | Roberto Vitillo’s Blog

March 22, 2022