-rbd - copy-on-read for clones » History » Version 1
Jessica Mack, 07/01/2015 12:05 AM
1 | 1 | Jessica Mack | h1. rbd - copy-on-read for clones |
---|---|---|---|
2 | |||
3 | h3. Summary |
||
4 | |||
5 | Implement copy-on-read for rbd clones |
||
6 | |||
7 | h3. Owners |
||
8 | |||
9 | * Li Wang (liwang@ubuntukylin.com) |
||
10 | * Yunchuan Wen (yunchuanwen@ubuntukylin.com) |
||
11 | |||
12 | h3. Interested Parties |
||
13 | |||
14 | * Name (Affiliation) |
||
15 | * Name (Affiliation) |
||
16 | * Name |
||
17 | |||
18 | h3. Current Status |
||
19 | |||
20 | h3. Detailed Description |
||
21 | |||
22 | This blueprint is originally proposed at |
||
23 | http://wiki.ceph.com/Planning/Sideboard/rbd%3A_copy-on-read_for_clones. |
||
24 | |||
25 | Rbd clone is currently implemented in the traditional way, copy-on-write, that is, only modified |
||
26 | data will be saved in clones, unmodified data will retrieve from parents. Since clones and their |
||
27 | parents may be placed in different pools across hosts, the read performance of clones may be poor. |
||
28 | Copy-on-read would improve locality for data which will be frequently accessed by a clone. |
||
29 | |||
30 | To improve the read performance for clones, copy-on-read is desired, that is, the data read by |
||
31 | clones from their parents will be saved into clones as well. Then subsequent read will hit from |
||
32 | clones. This is potentially useful in vitualization situations, that is, make a snapshot from a |
||
33 | parent image, then make several clones from the snapshot, each clone will be the backend of a |
||
34 | virutal machine. |
||
35 | |||
36 | h3. Work items |
||
37 | |||
38 | h4. Coding tasks |
||
39 | |||
40 | # add an copy-on-read option in file config_opts.h |
||
41 | # retrieve the corresponding objects from parent |
||
42 | librbd/internal.cc aio_read() |
||
43 | This function invokes Striper::file_to_extents() to converts image_extent into object_extents, |
||
44 | for each object_extent in object_extents, |
||
45 | let objectno = object_extent->objectno; |
||
46 | let off = 0; |
||
47 | invoke Striper::extent_to_file(..., objectno, off, ...) to retrieve the offset of the object into the image, |
||
48 | object_offset, |
||
49 | invoke Striper::file_to_extent(..., object_offset, object_size, ...) to retrieve all the object_extents inside |
||
50 | the object |
||
51 | asynchronously read these object_extents from parent into another buffer list prefetch_buffer |
||
52 | |||
53 | # write the objects into clones |
||
54 | librbd/AioRequest.cc AioRead::should_complete(int r) |
||
55 | after the completion of read_parent(), consruct a AioWrite request to asynchronously write object_extents into clones |
||
56 | |||
57 | h4. Build / release tasks |
||
58 | |||
59 | # Task 1 |
||
60 | # Task 2 |
||
61 | # Task 3 |
||
62 | |||
63 | h4. Documentation tasks |
||
64 | |||
65 | # Task 1 |
||
66 | # Task 2 |
||
67 | # Task 3 |
||
68 | |||
69 | h4. Deprecation tasks |
||
70 | |||
71 | # Task 1 |
||
72 | # Task 2 |
||
73 | # Task 3 |