Project

General

Profile

Mds - dumpability » History » Version 1

Jessica Mack, 05/28/2015 06:03 PM

1 1 Jessica Mack
h1. Mds - dumpability
2 1 Jessica Mack
3 1 Jessica Mack
h3. Task Name: 
4 1 Jessica Mack
5 1 Jessica Mack
mds: dumpability
6 1 Jessica Mack
7 1 Jessica Mack
h3. Size: 
8 1 Jessica Mack
9 1 Jessica Mack
M
10 1 Jessica Mack
11 1 Jessica Mack
h3. Skill: 
12 1 Jessica Mack
13 1 Jessica Mack
beginner
14 1 Jessica Mack
15 1 Jessica Mack
h3. Mentor(s):
16 1 Jessica Mack
17 1 Jessica Mack
"Sage Weil":mailto:sage@inktank.com
18 1 Jessica Mack
 
19 1 Jessica Mack
h3. Components: 
20 1 Jessica Mack
21 1 Jessica Mack
mds, common/Formatter
22 1 Jessica Mack
23 1 Jessica Mack
h3. Description:
24 1 Jessica Mack
25 1 Jessica Mack
A 'dumpcache <filename>' command will dump all inodes, dentries, and dirs to a file using the operator<<() methods.  This is a good start, but only captures what is exposed by those methods--not all structure fields.
26 1 Jessica Mack
All encodable objects (that go to disk or over the wire) include a dump(Formatter*) method that will generate structured json (or xml etc) output for debugging.  The in-memory only structures (like CInode, CDentry, CDir) don't have these (yet).
27 1 Jessica Mack
The admin socket infrastructure lets you query a running daemon from the command line (e.g., 'ceph daemon mds.a <command.') and get the output.  It is fully buffered (entire result is built in memory, then written to the output).
28 1 Jessica Mack
The Formatter class has JSON and XML implementations.  It is fully buffered (entire output is generated in memory, then written to the output socket).
29 1 Jessica Mack
 
30 1 Jessica Mack
We should add dump() methods to all important in-memory structures, including:
31 1 Jessica Mack
* CInode
32 1 Jessica Mack
* CDir
33 1 Jessica Mack
* CDentry
34 1 Jessica Mack
* Capability
35 1 Jessica Mack
36 1 Jessica Mack
Any dump should be recursive (i.e., dumping the inode will also dump the capabilities).  It should not following links, thoguh (dumping a dir shouldn't dump all dentries and inodes.... or should it?)
37 1 Jessica Mack
38 1 Jessica Mack
We should also capture other improtant state, like:
39 1 Jessica Mack
* MDRequest / Mutation
40 1 Jessica Mack
* Session
41 1 Jessica Mack
* LogSegments
42 1 Jessica Mack
43 1 Jessica Mack
Then we wire them up to admin/dev comamnds to dump cache and other in-memory state.
44 1 Jessica Mack
 
45 1 Jessica Mack
46 1 Jessica Mack
h3. External Documentation:
47 1 Jessica Mack
48 1 Jessica Mack
h4. Coding tasks
49 1 Jessica Mack
50 1 Jessica Mack
# mds: add dump methods to CInode, CDir, CDentry, Capability
51 1 Jessica Mack
# mds: add dump methods to Session, MDRequest, LogSegment
52 1 Jessica Mack
# admin socket dump commands
53 1 Jessica Mack
# tell dump commands (dump to a file)
54 1 Jessica Mack