> On April 5, 2016, 4:52 p.m., Jiang Yan Xu wrote: > > src/slave/containerizer/mesos/isolators/xfs/disk.hpp, line 33 > > <https://reviews.apache.org/r/44948/diff/11/?file=1321655#file1321655line33> > > > > Doesn't look like the utils header is used in this header? > > > > Otherwise add a blank line above.
Added the blank. The header is needed for the definition of ``prid_t``. > On April 5, 2016, 4:52 p.m., Jiang Yan Xu wrote: > > src/slave/containerizer/mesos/isolators/xfs/disk.cpp, lines 112-114 > > <https://reviews.apache.org/r/44948/diff/11/?file=1321656#file1321656line112> > > > > There is also the `uid.isNone()` case. > > > > We can just > > > > ``` > > if (!user.isSome()) { > > return Error("Failed to determine user: " + > > (uid.isError() ? uid.error() : "uid not found")); > > } > > ``` ``getuid(2)`` can't fail or return ``None``. > On April 5, 2016, 4:52 p.m., Jiang Yan Xu wrote: > > src/slave/containerizer/mesos/isolators/xfs/disk.cpp, lines 281-286 > > <https://reviews.apache.org/r/44948/diff/11/?file=1321656#file1321656line281> > > > > This is sort of safe in our case because we expect an empty sandbox. > > > > In a general case `xfs::setProjectId()` could partially fail which > > makes it unsafe to return the project ID. > > > > I think we can just do a hard CHECK before calling to make sure the > > directory is empty. If no such method is directory usable right now, add a > > TODO and let's add one to stout. As discussed, we keep the container Info record and depend on cleanup to return the project ID. - James ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/44948/#review126845 ----------------------------------------------------------- On April 5, 2016, 10:59 p.m., James Peach wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/44948/ > ----------------------------------------------------------- > > (Updated April 5, 2016, 10:59 p.m.) > > > Review request for mesos, Jie Yu and Jiang Yan Xu. > > > Bugs: MESOs-4828 > https://issues.apache.org/jira/browse/MESOs-4828 > > > Repository: mesos > > > Description > ------- > > Track sandbox directory usage by dynamically assigning XFS project > quotas. We track a range of XFS project IDs, assigning a project ID > and a project quota to each sandbox as it is created. When the task > reaches the quota, writes will fail with EDQUOT, and the task will have > an opportunity to handle that. > > Quotas are not applied to volume resources since the isolator interface > has no insight into the volume lifecycle. Thus it is not currently > possible to accurately assign and reclaim project IDs. > > If LOW is the lower bound of the project ID range and HIGH is the upper > bound, you can show the currently allocated project quotas using the > xfs_quota command: > > $ xfs_quota -x -c "report -a -n -L LOW -U HIGH" > > To show the project ID assigned to the file PATH, use the xfs_io command: > > $ xfs_io -r -c stat PATH > > > Diffs > ----- > > src/Makefile.am f22ae5b3bd9336a56c802e0e51d39d6cb675caf2 > src/slave/containerizer/mesos/containerizer.cpp > a5dd22380066aa85de04d485052084e2629681c0 > src/slave/containerizer/mesos/isolators/xfs/disk.hpp PRE-CREATION > src/slave/containerizer/mesos/isolators/xfs/disk.cpp PRE-CREATION > src/slave/containerizer/mesos/isolators/xfs/utils.hpp PRE-CREATION > src/slave/containerizer/mesos/isolators/xfs/utils.cpp PRE-CREATION > src/slave/flags.hpp d0c606eea74e1a2e69067c43a267047e65a22a04 > src/slave/flags.cpp 0551ec334c6747507bf7bb068d27d67f3fdd6c83 > > Diff: https://reviews.apache.org/r/44948/diff/ > > > Testing > ------- > > Make check. Manual testing. Tests in subsequent patches. > > > Thanks, > > James Peach > >