]> git.proxmox.com Git - ceph.git/blame - ceph/doc/dev/rbd-diff.rst
update ceph source to reef 18.2.1
[ceph.git] / ceph / doc / dev / rbd-diff.rst
CommitLineData
7c673cae
FG
1RBD Incremental Backup
2======================
3
4This is a simple streaming file format for representing a diff between
5two snapshots (or a snapshot and the head) of an RBD image.
6
7Header
8~~~~~~
9
10"rbd diff v1\\n"
11
12Metadata records
13~~~~~~~~~~~~~~~~
14
15Every record has a one byte "tag" that identifies the record type,
16followed by some other data.
17
18Metadata records come in the first part of the image. Order is not
19important, as long as all the metadata records come before the data
20records.
21
22From snap
23---------
24
25- u8: 'f'
26- le32: snap name length
27- snap name
28
29To snap
30-------
31
32- u8: 't'
33- le32: snap name length
34- snap name
35
36Size
37----
38
39- u8: 's'
40- le64: (ending) image size
41
42Data Records
43~~~~~~~~~~~~
44
45These records come in the second part of the sequence.
46
47Updated data
48------------
49
50- u8: 'w'
51- le64: offset
52- le64: length
53- length bytes of actual data
54
55Zero data
56---------
57
58- u8: 'z'
59- le64: offset
60- le64: length
61
62
63Final Record
64~~~~~~~~~~~~
65
66End
67---
68
69- u8: 'e'
70
71
72Header
73~~~~~~
74
75"rbd diff v2\\n"
76
77Metadata records
78~~~~~~~~~~~~~~~~
79
80Every record has a one byte "tag" that identifies the record type,
81followed by length of data, and then some other data.
82
83Metadata records come in the first part of the image. Order is not
84important, as long as all the metadata records come before the data
85records.
86
87In v2, we have the following metadata in each section:
88(1 Bytes) tag.
89(8 Bytes) length.
90(n Bytes) data.
91
92In this way, we can skip the unrecognized tag.
93
94From snap
95---------
96
97- u8: 'f'
98- le64: length of appending data (4 + length)
99- le32: snap name length
100- snap name
101
102To snap
103-------
104
105- u8: 't'
106- le64: length of appending data (4 + length)
107- le32: snap name length
108- snap name
109
110Size
111----
112
113- u8: 's'
114- le64: length of appending data (8)
115- le64: (ending) image size
116
117Data Records
118~~~~~~~~~~~~
119
120These records come in the second part of the sequence.
121
122Updated data
123------------
124
125- u8: 'w'
126- le64: length of appending data (8 + 8 + length)
127- le64: offset
128- le64: length
129- length bytes of actual data
130
131Zero data
132---------
133
134- u8: 'z'
135- le64: length of appending data (8 + 8)
136- le64: offset
137- le64: length
138
139
140Final Record
141~~~~~~~~~~~~
142
143End
144---
145
146- u8: 'e'