IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> JavaScript知识库 -> 6.824 2020春 论文阅读 FaRM -> 正文阅读

[JavaScript知识库]6.824 2020春 论文阅读 FaRM

0. Prelude

This article is relevant to lecture 14. Although this paper take a lot of space to talk about fault recovery, I will ignore these which is unimportant for the lecture.

1. Overview

  • FaRMis distributed in-memory database , which consists of many machines in one datacenter(including clients) and leverage RDMA and DRAM with UPS technology .
  • Configuration file comprised of a tuple < i , S , F , C M > <i, S,F,CM> <i,S,F,CM> representing a unique configuration identifier, the set of machines comprising FaRM, a mapping from machines to failure domains and configuration manager respectively, is spread by zookeeper.
  • FaRM exposes a global address comprised 2 GB region to the application.
  • Configuration manager maintains a mapping from region identifier to primary and backup machines storing corresponding region(this mapping is not stored in zookeeper and will be cached in other machines) and is responsible for allocating new region.

2. Transaction process

An atomic distributed transaction which is driven by clients like Spanner can be split into following steps.

  1. Read all the objects needed to read from primary servers storing these objects and remember each version number.
  2. buffer all writes in local memory
  3. Send each primary server storing written objects a Lock log record using RDMA(actually, each machine need to reserve a RDMA queue pair of message and log respectively for each other machine).
  4. Primary servers will try to lock each written object and check whether version number of each written object has changed. If locking some object fails or version number has changed, the transaction must be aborted, otherwise the server will reply a LOCK-REPLY message to the client, which plays the coordinator role in two phase commit.
  5. Once receiving all LOCK-REPLY messages, client starts to validate all
  6. client sends a COMMIT-BACKUP log record to each backup server.
  7. As long as receiving all hardware ACK from backup server, client will send a COMMIT-PRIMARY message to all primary server. Once receiving an ACK, client API can return COMMIT SUCCESS to API caller(from recovery protocol, we can see system with replica number equal to F can guarantee that this interrupted transaction will be committed even though F replica machines storing the same object fail from the time of receiving one COMMIT-PRIMARY ACK).

3. Discussion about correctness

Actually, what I describe about transaction process above has a fatal error(I did not realize it when reading the paper until the teacher pointed it out in the lecture).

Before discussing where is the error, we first talk about serialization point I define as a timestamp at which all operations specified in a transaction are completed immediately.

Two phase lock scheme, easy to find we can consider the timestamp when we get all locks needed in the transaction as the serialization point.

We will see lock scheme of this paper is essentially identical with two phase lock, so defines the same serialization point. Consider following example.

T1 begin 
read x
if x = 0
  set y = 1
T1 end

T2 begin
read y
if y = 0
  set x = 1
T2 end

And following execution order.

--------> time
T1: read x  lock y validate x                          commit
T2:                           read y lock x validate y commit

If in validation stage we only check version number, T1 and T2 will both commit successfully, which is not a serializable result !

So we do need a adjustment in the validation stage. Now, validating object y not only check version number, but also check whether lock of object y is being acquired by others.

this adjustment essentially guarantee that anyone can’t read y once we have locked y.

If we think reading object y acquire read lock at the same time, and release read lock when validating y successfully, optimistic concurrency control of the paper is reduced to two phase lock scheme!

4. Limitation

  • Application code can see inconsistencies while executing transactions that will eventually abort. For example, if the transaction reads a big object at the same time that a committing transaction is overwriting the object.
  • scalability?
  JavaScript知识库 最新文章
ES6的相关知识点
react 函数式组件 & react其他一些总结
Vue基础超详细
前端JS也可以连点成线(Vue中运用 AntVG6)
Vue事件处理的基本使用
Vue后台项目的记录 (一)
前后端分离vue跨域,devServer配置proxy代理
TypeScript
初识vuex
vue项目安装包指令收集
上一篇文章      下一篇文章      查看所有文章
加:2022-02-26 11:22:00  更:2022-02-26 11:24:15 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/24 10:30:23-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码