Erasure Coding in Windows Azure Storage

Erasure Coding in Windows Azure Storage

0. Abstract

Windows Azure Storage (WAS)使用纠删码,引入了LRC的概念,减少修复所需要的块数,从而减小带宽和I/O

1. Introduction

(WAS)的一个简介

stream layer

append-only distributed file system

active-extents

replicated three times by the underlying stream layer.

先写入三副本,达到一定大小,区域会被sealed,不能再被修改,成为纠删码的候选区,开始编码,编码结束,删除3副本

使用纠删码可以降低成本50%以上,存储马上达到EB,节省更多硬件,节省数据中心占地面积,节省电力。

trade-off是性能

dealing with

a lost or offline data fragment

hot storage nodes

数据不可用两种情况

丢失

所需数据在升级的节点上

重构返回数据给客户端,需要优化,优化方向

networking bandwidth

I/Os

重构时间

纠删码,数据块存储在特定的节点上,增加了存储节点变热的风险,影响时延(疑问?有一篇说分片可以有效地减少负载不均衡)

WAS处理方法,识别热片段,存储到较冷的节点从而负载均衡,或者cache缓存数据,提供服务。

但是这样在完成迁移和cache缓存前,会影响性能,优化,如果读太久,直接重构。

所以对重构时间有要求,时间取决于最慢的节点

(12,4),重构成本大

减小读取片段数的好处

reduces the network overhead and number of I/Os

reduces the time it takes

引入了LRC实现(关键点在于98%的故障时单点故障,所以LRC很有用)

2. Local Reconstruction Codes

2.1 Definition

举了个(6.3)的例子

image-20211020111728150

LRC(k,l,r)

2.2 Fault Tolerance

容错的例子

构造特定系数实现Maximally Recoverable(MR) property

image-20211020112525634

2.2.1 Constructing Coding Equations

image-20211020112611275

image-20211020163149256

这种情况下可以容任意3错,问题是如何求系数

关注以下情况

None of the four parities fails

Only one of px and py fails

both px and py fails

这三种情况是可以解码的(具体内容可以之后再看看)

2.2.2 Putting Things Together

可以对3中4错情况进行解码,占所有4故障的86%,实现了最大可恢复属性

2.2.3 Checking Decodability

如何判断是否可恢复

对于每个本地组,如果校验块是可用的可以当作一个缺失的数据块,校验块标记为删除,完成本地组后,检查数据片段和全局校验块。如果缺失的数据片段数不超过全局校验块的数量,则理论上是可解的。否则不可解码。

2.3 Optimizing Storage Cost, Reliability and Performance

LRC(k, l, r)

单故障错误,修复需要k/l片段

可以容r+1错

n-k >= l+r

2.4 Summary

(k,r,l)容错在r+1 - r+l(能容多少错,取决于具体的故障情况)

3. Reliability Model and Code Selection

LRC的参数选择问题,可靠性要达到三副本的可靠性

3.1 Reliability Model

利用Markov models来进行判断

3.1.1 Markov models

image-20211020172107114image-20211024160740251

利用马尔可夫链求出了MTTF

比三副本和(6,3)都要高,因为容任意三错,并且可以容86%的4错

3.2 Cost and Performance Trade-offs

image-20211024161613591

每个点代表一组参数

下界,代表相同存储冗余。重建开销较小。

3.3 Code Parameter Selection

 

image-20211024162130837

3.4 Comparison - Modern Storage Codes

Weaver codes

HoVer codes

Stepped Combination codes

这三种编码回头可以看看

image-20211024163631562

性能好处在于

校验分为本地和全局的

本地校验只涉及最小的数据片段

全局涉及所有数据片段,可以提供多个容错性

其他编码都是相同的责任,重构和容错

3.5 Correlated Failures

马尔可夫链 要求是独立的,所以我们分别放置在不同的地方。如果有例外的情况要在链上添加弧。

4. Erasure Coding Implementation in WAS

分为三层

front-end layer

partitioned object layer stream replication layer(EC实现)这个地方有个东西需要再看看

4.1 Stream Layer Architecture

Stream Managers

image-20211023153158529

Streams

save a list of extents

a list of append blocks

each block CRC(循环冗余校验(Cyclic Redundancy Check, CRC))

extent is replicated on multiple (usually three) ENs

Write operations for a stream keep appending to an extent

the extent reaches its maximum size (in the range of 1GB-3GB)

there is a failure in the replica set

4.2 Erasure Coding in the Stream Layer

erasure coding process

completely asynchronous

off the critical path of client writes

  1. SM creates fragments on a set of ENs

  2. SM designates one of the ENs in the extent’s replica set as the coordinator of erasure coding

  3. sends it the metadata for the replica set

image-20211023194815165

4.3 Using Local Reconstruction Codes in Windows Azure Storage

placement of the fragments

load 为了负载均衡

reliability 尽量不放在相同域

涉及到一个升级域的概念 需要再研究下

4.4 Designing for Erasure Coding

Scheduling of Various I/O Types

stream layer handles a large mix of I/O types

open/close, read, and append operations from clients, create, delete, replicate, reconstruct, scrub, and move operations generated by the system itself

这么多操作,存在调度问题

Reconstruction Read-ahead and Caching

等不可用片段达到一定大小再开始重建,减少磁盘和I/O的数量

Consistency of Coded Data

检查数据一致性

Checksum and parity是防止数据损坏的两个主要机制

5. Performance

与RS码在大小两种I/O下进行比较

LRC(12,2,2)和RS(12,4)进行比较

(12,3)的可靠性低于三副本

5.1 Small I/Os

key metric(4KB to64KB range)

latency

the number of I/Os taken

负载较轻时,没有太大区别。

负载较重时,读取很多块,延迟取决于最慢的片段,选择更多的数据片段。有效降低延迟。

LRC读的块数少延迟低,虽然比更多的片段延迟大,但是带宽节省更多

image-20211022190238660

5.2 Large I/Os

4MB large I/Os(4MB large I/Os)

latency

bandwidth consumption

负载较轻时,时延仍然增大

延迟在网络和磁盘带宽

1Gbps network

LRC由于减少了数据传输量,性能提高,片段越多反而性能越差

 

image-20211022193653754

5.3 Decoding Latency

LRC比RS解码快,但是解码比传输小几个数量级,并不重要。

 

6. Related Work

Erasure Coding in Storage Systems

很多系统使用了纠删码

Performance

在擦码存储系统中,节点故障会触发重构进程,导致重构读取时的延迟性能下降。此外,经验表明,没有数据丢失的瞬时错误占数据中心故障的90%以上

重构会导致读性能下降

Erasure Code Design

这部分没看懂,需要一会再看看

7. Summary

引入LRC 从(12,4)改为(12,2,2),比传统的三副本持久性好(应该没有(12,4)好)

 

 

本文评价,属于LRC在系统上的实现以及相关的细节,理论相较于之前的LRC文章,感觉变化不大。

posted @ 2021-10-27 11:06  渴望成为大佬的菜鸡  阅读(373)  评论(0)    收藏  举报