Project

General

Profile

Cephfs quota support » History » Version 1

Jessica Mack, 06/22/2015 01:53 AM

1 1 Jessica Mack
h1. Cephfs quota support
2
3
h3. Summary
4
5
Enable quota support for Cephfs. We want to implement quota support on individual directory hierarchies, it does not distinguish users and groups, like XFS's project quota. Since currently, Ceph does not have an united uid/gid mechnism, implement the traditional user and group based quota support is hard to use.
6
7
h3. Owners
8
9
* Li Wang (UbuntuKylin)
10
11
h3. Interested Parties
12
13
* Yan, Zheng (Intel)
14
* Sage
15
* Greg
16
* Anip Patel (Arizona State University(student))
17
18
h3. Current Status
19
20
With original design
21
22
h3. Detailed Description
23
24
- add an optional directory property for the quota limit
25
  - add quota_info_t struct to inode_t
26
- protect quota_info_t with policylock
27
  - add to CInode::{encode,decode}_lock_state
28
- allow setting the quota
29
   see Server::handle_set_vxattr()
30
   fsetxattr(dirfd, "ceph.quota.max_bytes", "123000000")
31
   fsetxattr(dirfd, "ceph.quota.max_files", "123000")
32
- tell client qtree_ino when WR cap is issued
33
   add a CInode::get_containing_qtree() helper
34
- client: track qtree_ino for any open file for write
35
- client: is expected to keep quota parent open in its cache and limit
36
its writes
37
  - it can getattr the quota parent, watch for rbytes >= quota_max
38
- maybe, mds pushes quotatree rbytes updates to client when there are
39
significant change
40
 
41
If we do want to track actually used file space, the algorithm could be,
42
For each OSD object write operation, OSD return the offset to the actual object size (before writing) in the reply, the offset may be positive or minus, client calculates all the offsets to get a total offset, tell the total offset to MDS, MDS maintain the total used space for a file by add the total offset reported by client.
43
The major problem for this algorithm is that if for some reason, some client does not tell the MDS the offset, MDS may get that the actual used file size is less than zero. For example, a file is originall 2MB,
44
one client write it to 8MB, then the other client truncate it to 2MB. The first client should tell MDS offset be +6MB, the second client should tell MDS offset be -6MB. If the former get lost, MDS will think the file now be 2MB-6MB=-4MB. In that case, something like quota check will need, that is expensive.
45
 
46
h3. Work items
47
48
h4. Coding tasks
49
50
# Task 1
51
# Task 2
52
# Task 3
53
54
h4. Build / release tasks
55
56
# Task 1
57
# Task 2
58
# Task 3
59
60
h4. Documentation tasks
61
62
# Task 1
63
# Task 2
64
# Task 3
65
66
h4. Deprecation tasks
67
68
# Task 1
69
# Task 2
70
# Task 3