V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  wqlin  ›  全部回复第 3 页 / 共 13 页
回复总数  257
1  2  3  4  5  6  7  8  9  10 ... 13  
@ghostwind #3 问一波,为啥刷完 6.824 才面,数据库啥的不刷吗。我也在刷 6.824 ,加个 wx 交流下?
主从复制是为了提高可用性()和性能(读请求可以走从库,主库压力不会太大)。一般有好几种方式,以向数据库写数据为例:
1. 可以只等主库确认,那么就可以认为这次请求成功了;然后后续由主库将数据复制给其他从库( push 方式,也可以 pull )
2. 可以等主库将数据复制给全部从库,这样可以保证主从数据始终一致,不过这样性能不太高
3. 可以等主库将数据复制给部分从库,这样是上述两个方案的折中。
我们平时使用 mysql 主从复制的话,一般是第一种,不过 mysql 也支持第三种。那么就可能出现从库数据不一致。如果楼主应用能忍受这样的不一致,那么读从库就无所谓。如果要想读到最新的数据,可以将读请求路由到主库也是一种办法。不过这样主库读写压力会比较大。
不过还可以选择天生分布式数据库,国产 Tidb 这类
2018-08-09 22:34:48 +08:00
回复了 linbingqinag 创建的主题 问与答 raft 算法
第一个
2018-08-09 18:27:30 +08:00
回复了 linbingqinag 创建的主题 程序员 raft 算法投票的截止条件?
3/2 等于 1 吧。。int 计算的话。实际上就是计算 majority 的数量 = 集群总服务器 /2 + 1。+1 为了处理偶数个服务器
2018-08-03 13:43:48 +08:00
回复了 shenlei 创建的主题 职场话题 广州 offer,大家参谋下看看哪个更好?
@csuzhangxc #6 想去 PingCAP,想问下有什么要求吗。稍微熟悉分布式一致性协议
2018-08-02 13:58:05 +08:00
回复了 zhongxigeng 创建的主题 酷工作 [杭州] 阿里中间件高可用团队 | 吐槽了那么久的异地多活
有点好奇这种高可用怎么做?分布式复制,一致性协议吗
2018-06-14 23:15:47 +08:00
回复了 Allianzcortex 创建的主题 职场话题 回看这两年,真的是唏嘘不已
没怎么看懂...表达下关心
2018-06-04 21:00:18 +08:00
回复了 streamo 创建的主题 程序员 实现 Raft 时遇到的一个细节问题,求指点
@streamo #4 不记得是不是只有这里涉及了 blank no-op,但是思想是相同的,就是新的 leader 上任后可以自己 propose 一个 command 帮助 commit,SO 的这个问题 https://stackoverflow.com/questions/37210615/raft-term-condition-to-commit-an-entry 有提到:
>
What this means in practice is when a leader is elected, it typically commits a no-op entry to force a commit in its current term. The leader doesn't increase its commitIndex until the no-op entry is stored on a majority of servers.
>
而且找到一个 Raft 实现,详见: https://github.com/yahoo/gondola,专门分出了一个 blank command:
>
Note blank commands (command 3) are written into the log after a leader election. This is due to a Raft requirement that entries are not considered committed unless the last committed entry is of the current term. Applications need to ignore these blank commands.
>

活锁是否重要取决于应用程序,如果能保证 client 会不同的 propose,那么不处理也没事。但是通常情况下都无法保证,所以一般使用 blank command 帮助 commit
2018-06-04 16:36:42 +08:00
回复了 streamo 创建的主题 程序员 实现 Raft 时遇到的一个细节问题,求指点
@streamo #2 找到了,在 raft thesis 中 6.4 Processing read-only queries more efficiently 中提到了:
>
If the leader has not yet marked an entry from its current term committed, it waits until it
has done so. The Leader Completeness Property guarantees that a leader has all committed
entries, but at the start of its term, it may not know which those are. To find out, it needs to
commit an entry from its term. Raft handles this by having each leader commit a blank no-op
entry into the log at the start of its term. As soon as this no-op entry is committed, the leader ’ s
commit index will be at least as large as any other servers ’ during its term.
>
2018-06-04 15:34:20 +08:00
回复了 streamo 创建的主题 程序员 实现 Raft 时遇到的一个细节问题,求指点
嗯,如果在 term 2 的时候没有 propose 新的日志,那么 server 2 就不能 commit 101-105 这几条日志,所以就可能出现活锁的问题。Raft 作者在论文提到新的 leader 上任后可以提交一个空的日志,帮助 commit,但是一时没找到在哪里...
2018-05-21 12:46:48 +08:00
回复了 wqlin 创建的主题 编程 写完了今年(2018)的 6.824 lab 了
@lsmgeb89 #9 嗯,是啊
2018-05-21 12:03:21 +08:00
回复了 wqlin 创建的主题 编程 写完了今年(2018)的 6.824 lab 了
@lsmgeb89 😂我用了快小半年了
2018-05-21 12:02:26 +08:00
回复了 wqlin 创建的主题 编程 写完了今年(2018)的 6.824 lab 了
@c0pper 断断续续写的,lab 2 用了快两个月,后面两个也用了两个月
2018-05-21 11:41:51 +08:00
回复了 wqlin 创建的主题 编程 写完了今年(2018)的 6.824 lab 了
@all4win 没有,不过有测试文件
2018-05-21 10:23:06 +08:00
回复了 wqlin 创建的主题 编程 写完了今年(2018)的 6.824 lab 了
@c0pper lab2 是 lab3 和 lab4 的基础,后面写 3 和 4 都回来改 2 的代码。。
2018-05-20 15:25:47 +08:00
回复了 binbinyouliiii 创建的主题 编程 Javaer 应该学习哪门语言“性价比高”
补全语言知识?我觉得不如视野再开阔点,系统学习下编程语言:静态语言,动态语言,函数式,面向对象,强类型,弱类型...可以搜搜 programming lanaguage。只有一两门语言感觉没有质变
2018-05-19 13:26:54 +08:00
回复了 wqlin 创建的主题 Go 编程语言 如何 debug 超过 8192 个活跃的 goroutine
@rcmerci 好的,谢谢
2018-05-19 13:26:46 +08:00
回复了 wqlin 创建的主题 Go 编程语言 如何 debug 超过 8192 个活跃的 goroutine
@mengzhuo 了解
1  2  3  4  5  6  7  8  9  10 ... 13  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1850 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 33ms · UTC 16:29 · PVG 00:29 · LAX 09:29 · JFK 12:29
Developed with CodeLauncher
♥ Do have faith in what you're doing.