Masutangu

也許我這一生 始終在追逐那顆九號球

Designing Data-Intensive Applications 读书笔记(四)

Chapter 8. The Trouble with Distributed Systems Faults and Partial Failures In a distributed system, there may well be some parts of the system that are broken in some unpredictable way, even tho...

Designing Data-Intensive Applications 读书笔记(三)

Chapter 6. Partitioning For very large datasets, or very high query throughput, that is not sufficient: we need to break the data up into partitions, also known as sharding. The main reason for w...

Core dump 原理探究学习笔记(二)

本系列文章是读《coredump问题原理探究》的读书笔记。 函数逆向 这是将要逆向的样例源码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 #include <stdio.h> #include <string.h> int main(int argc, char* argv[]) { f...

Core dump 原理探究学习笔记(一)

本系列文章是读《coredump问题原理探究》的读书笔记。 函数调用帧 先看一个例子 1 2 3 4 5 6 7 8 9 10 11 12 13 // test.cpp int func(int c, char* s, int off) { int a = 0x12345678; int *p = &a; int res = c + *(s + off); r...

Designing Data-Intensive Applications 读书笔记(二)

Chapter 4. Encoding and Evolution When a data format or schema changes, a corresponding change to application code often needs to happen. However, in a large application, code changes often cannot...

Designing Data-Intensive Applications 读书笔记(一)

Chapter 1. Reliable, Scalable, and Maintainable Applications Thinking About Data Systems Increasingly many applications now have such demanding or wide-ranging requirements that a single tool can...

TiKV 源码阅读(未完成)

TiKV 使用 RocksDB 做持久化存储引擎。将 key 分 range,每一段称为 Region。Region 分散在多台机器上以实现存储的水平扩展。每个 Region 会存放多个副本在不同机器上,使用 raft 算法管理: PD 负责整个 TiKV 集群的调度。 TiKV 使用 version 的方式进行多版本控制(MVCC): 1 2 3 4 5 6 7 Key1-Ver...

raft-rust 初体验

之前分析了使用 golang 实现的 etcd-raft,这几天再读了下 rust 实现的 raft-rs,简单说下对比。rust 版应该是基于 golang 版来实现的,所有的类、方法基本上是一致的。 从样例看起,let (sender, receiver) = mpsc::channel(); 创建了 channel 用于线程之间数据传递(类似 golang 的 channel)。调用...

etcd-raft 源码学习笔记(PreVote)

这篇文章介绍 etcd-raft 的 PreVote 机制,避免由于网络分区导致 candidate 的 term 不断增大。 Election timeout 之后,发送 type 为 pb.MsgHup 的请求,进入选举阶段: 1 2 3 4 5 6 7 8 9 // tickElection is run by followers and candidates after r.el...

etcd-raft 源码学习笔记(Leader Transfer)

这篇文章介绍 etcd-raft 如何实现 leadership transfer,把 leader 身份转移给某个 follower。 应用层调用 TransferLeadership 方法,发送一个 type 为 pb.MsgTransferLeader 的请求给 raft 处理。 1 2 3 4 5 6 7 8 func (n *node) TransferLeadership(c...