zookeeper 内部蹩脚问题(未回答完)

2024-03-21 17:48

本文主要是介绍zookeeper 内部蹩脚问题(未回答完),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!


 1.     说说zookeeper和chubby的Snapshots

Zookeeper使用的是fuzzy snapshot,中文意思大概是模糊的snapshot,但是,论文wait-free说到可能会有notvalid的时候

Chubby同样具有snapshots ,用了三种方式,原文是这样的:

Our firstimplementation of the fault-tolerant database blocked the system very brieflywhile making an in-memory copy of the (small) database. It then stored thecopied data on disk via a separate thread. Subsequently we implementedvirtually pause-less snapshots. We now use a “shadow” data structure totrack updates while the underlying database is serialized to disk.

 

 

2.     Leader是干嘛用的?

 To assign serial id's to all updates andconfirm that a quorum has received the update.

 

3.      Zookeeper可以干什么(答案应该比较多)

 event notification,locking, and as a priority queue mechanism另一个方面,对于read非常多的应用程序适合使用,因为Replication is used for scalability andreliability 

 

4.      为什么说zookeeper不能做数据存储?

Using a memorybased system also mean you are limited to the amount of data that can fit inmemory, so it's not useful as a general data store.

It's meant tostore small bits of configuration information rather than large blobs.

 

 

5.      为什么说ZooKeeper 比起事件通知系统更像是一个基于状态的系统? 

Watches are set as a side-effect of gettingdata so you'll always have a valid initial state and on any subsequent changeevents you'll refresh to get new values. If you want to use events to log whenand how something changed, for example, then you can't do that. You would haveto include change history in the data itself. 

 

6.      Watch事件?

可以watch的event包括如下的二种:

KeeperState:Disconnected,SyncConnected,Expired

EventType:None,NodeCreated,NodeDeleted,NodeDataChanged,NodeChildrenChanged

 

7.      Zookeeper有冲突的问题吗?

ZK那样一开始就提出对/zk/a,可能会有两个请求同时提交要更新该值会抛出BadVersion的异常,另外i,因为所有的zxid分配都是leader分配的,在最坏的情况下,leader刚把写请求发送出去后,挂了,同时,更为糟糕的是,所有的followers都没有收到该请求,重新选择leader后,那么为了保证每一个proposal都有一个唯一的id,新的leader的赋予了一个新的epoch,这就区别前一个的leader,前一个leader(此时不是leader)又活过来,则它的那个未发出的消息则会被truncate掉

 

8.      Zookeeper有活锁的问题吗?

不会有活锁问题,对于同时处理同一个值的话,leader只会重新将该值的请求发送给自己来再次提交。

 

9.      Libpaxos和chubby的活锁问题是如何解决的?

难道使用的是paxos made simple中提到的If the distinguished proposer can communicate successfully with amajority of acceptors, and if it uses a proposal with number greater than anyalready used, then it will succeed in issuing a proposal that is accepted. Byabandoning a proposal and trying again if it learns about some request with ahigher proposal number, the distinguished proposer will eventually choose ahigh enough proposal number.

 

10.  Zookeeper为什么需要两阶段?

Paxos之所以使用两阶段,是因为需要第一阶段来保证有大多数的acceptors选择了proposal,zookeeper的话,如果稳定下来,是不是直接就可以一次提交了呢?这个需要确认一下

 

11.  Zookeeper怎么知道其他的Followersproposal都commit了呢?

It accomplishes this taskby queuing to a newly connected follower any PROPOSAL it has that the followerhas not seen, and then queuing a COM-MIT for all such proposals up to the lastmessage committed. After all such messages have been queued, the leader adds thefollower to the broadcast list for future PROPOSALs and ACKs

 

12.  Session id的初始化?

Id为server id

   longnextSid = 0;

   longmill = System.currentTimeMillis();

   nextSid= (System.currentTimeMillis() << 24) >> 8;

   nextSid=  nextSid | (id <<56);


13.  什么叫做idempotent,?

14.  zookeeper写请求是怎么样的工作流程?

15.  Zab does notpersistently record the id of every message delivered, Zab may redeliver amessage during recovery?

16.  写请求流程?

17.  Redelivery使用在zookeeper哪里?

 

 

 

论文:

[1] zookeeper:wait-free http://static.usenix.org/event/usenix10/tech/full_papers/Hunt.pdf

[2] A simple totally ordered broadcastprotocol http://research.yahoo.com/files/ladis08.pdf

这篇关于zookeeper 内部蹩脚问题(未回答完)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/833426

相关文章

如何解决idea的Module:‘:app‘platform‘android-32‘not found.问题

《如何解决idea的Module:‘:app‘platform‘android-32‘notfound.问题》:本文主要介绍如何解决idea的Module:‘:app‘platform‘andr... 目录idea的Module:‘:app‘pwww.chinasem.cnlatform‘android-32

kali linux 无法登录root的问题及解决方法

《kalilinux无法登录root的问题及解决方法》:本文主要介绍kalilinux无法登录root的问题及解决方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,... 目录kali linux 无法登录root1、问题描述1.1、本地登录root1.2、ssh远程登录root2、

SpringBoot应用中出现的Full GC问题的场景与解决

《SpringBoot应用中出现的FullGC问题的场景与解决》这篇文章主要为大家详细介绍了SpringBoot应用中出现的FullGC问题的场景与解决方法,文中的示例代码讲解详细,感兴趣的小伙伴可... 目录Full GC的原理与触发条件原理触发条件对Spring Boot应用的影响示例代码优化建议结论F

MySQL 中查询 VARCHAR 类型 JSON 数据的问题记录

《MySQL中查询VARCHAR类型JSON数据的问题记录》在数据库设计中,有时我们会将JSON数据存储在VARCHAR或TEXT类型字段中,本文将详细介绍如何在MySQL中有效查询存储为V... 目录一、问题背景二、mysql jsON 函数2.1 常用 JSON 函数三、查询示例3.1 基本查询3.2

Pyserial设置缓冲区大小失败的问题解决

《Pyserial设置缓冲区大小失败的问题解决》本文主要介绍了Pyserial设置缓冲区大小失败的问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面... 目录问题描述原因分析解决方案问题描述使用set_buffer_size()设置缓冲区大小后,buf

resultMap如何处理复杂映射问题

《resultMap如何处理复杂映射问题》:本文主要介绍resultMap如何处理复杂映射问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录resultMap复杂映射问题Ⅰ 多对一查询:学生——老师Ⅱ 一对多查询:老师——学生总结resultMap复杂映射问题

java实现延迟/超时/定时问题

《java实现延迟/超时/定时问题》:本文主要介绍java实现延迟/超时/定时问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Java实现延迟/超时/定时java 每间隔5秒执行一次,一共执行5次然后结束scheduleAtFixedRate 和 schedu

如何解决mmcv无法安装或安装之后报错问题

《如何解决mmcv无法安装或安装之后报错问题》:本文主要介绍如何解决mmcv无法安装或安装之后报错问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录mmcv无法安装或安装之后报错问题1.当我们运行YOwww.chinasem.cnLO时遇到2.找到下图所示这里3.

浅谈配置MMCV环境,解决报错,版本不匹配问题

《浅谈配置MMCV环境,解决报错,版本不匹配问题》:本文主要介绍浅谈配置MMCV环境,解决报错,版本不匹配问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录配置MMCV环境,解决报错,版本不匹配错误示例正确示例总结配置MMCV环境,解决报错,版本不匹配在col

Vue3使用router,params传参为空问题

《Vue3使用router,params传参为空问题》:本文主要介绍Vue3使用router,params传参为空问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录vue3使用China编程router,params传参为空1.使用query方式传参2.使用 Histo