Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-13353

quickly determine if a quota is exceeded

Details

    • Improvement
    • Resolution: Won't Do
    • Minor
    • None
    • None
    • 9223372036854775807

    Description

      We run a script that checks the quota status of users and informs them if they are over quota. Currently we run lfs for each user and it can take a long time for a large system with a lot of users.

      So far I've found that I can use llapi_quotactl() (which lfs also uses) to get the necessary information. However, to make llapi_quotactl() run faster, I set dqb_valid to non-zero per the man page for llapi_quotactl(). This seems to work correctly in that I don't cause communication between the QMT and QSDs, but I don't get some of the important information (dqb_curspace and dqb_curinodes) that's used to determine if a user is exceeding a quota (also as expected, per the man page).

      However, I believe the struct lquota_entry.lqe_edquot flag has the information I want. It may not be completely up to date at all times, but that's ok because it's not being used in real time for this script. I can get a hold of it by passing it back to the llapi_quotactl() call in unused space in the struct obd_quotactl which comes out in user space as a struct if_quotactl. I'm just putting all the flags in the struct lquota_entry into the unused flags portion of the struct if_quotactl.

      Is there an easier way to get this information (relatively) quickly?

      Attachments

        Activity

          [LU-13353] quickly determine if a quota is exceeded

          I can't change the type either, but that's probably not a surprise at this point.

          defazio Gian-Carlo Defazio added a comment - I can't change the type either, but that's probably not a surprise at this point.
          pjones Peter Jones added a comment -

          Well, I can't edit that either. jgmitter I know that we have seen this kind of thing in the past - is the workaround to move to the ticket to this same project? I did not want to do that without confirmation as it will mess up the commit message for the the patch in flight.

          pjones Peter Jones added a comment - Well, I can't edit that either. jgmitter I know that we have seen this kind of thing in the past - is the workaround to move to the ticket to this same project? I did not want to do that without confirmation as it will mess up the commit message for the the patch in flight.
          ofaaland Olaf Faaland added a comment -

          Thanks Andreas

          ofaaland Olaf Faaland added a comment - Thanks Andreas

          Olaf, I'm unable to do that either. It might be something with Jira. I think Peter has the most admin privilege here, so hopefully he can change it.

          adilger Andreas Dilger added a comment - Olaf, I'm unable to do that either. It might be something with Jira. I think Peter has the most admin privilege here, so hopefully he can change it.
          ofaaland Olaf Faaland added a comment -

          Hi Gian-Carlo, can you change the "type" on this ticket to "Improvement"? For whatever reason I'm unable to do it. Thanks.

          ofaaland Olaf Faaland added a comment - Hi Gian-Carlo, can you change the "type" on this ticket to "Improvement"? For whatever reason I'm unable to do it. Thanks.

          Gian-Carlo DeFazio (defazio1@llnl.gov) uploaded a new patch: https://review.whamcloud.com/37908
          Subject: LU-13353 quota: quickly determine if quota exceeded
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 8bd14f3e1e7cfab53ad045465483c7c6373fcf13

          gerrit Gerrit Updater added a comment - Gian-Carlo DeFazio (defazio1@llnl.gov) uploaded a new patch: https://review.whamcloud.com/37908 Subject: LU-13353 quota: quickly determine if quota exceeded Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 8bd14f3e1e7cfab53ad045465483c7c6373fcf13

          Hi Olaf,

          The "lquota_entry.lqe_edquot" can be packed into "dqi_flags" (struct obd_dqinfo) in QMT and return to client side,
          the more efficient way to get the quota information of all users/groups could be defining a new quota calling type to
          getting all quota information (the processing is similar as "cat /proc/fs/lustre/qmt/lustre-QMT0000/dt-0x0/glb-usr")
          from QMT and send it to client.

          hongchao.zhang Hongchao Zhang added a comment - Hi Olaf, The "lquota_entry.lqe_edquot" can be packed into "dqi_flags" (struct obd_dqinfo) in QMT and return to client side, the more efficient way to get the quota information of all users/groups could be defining a new quota calling type to getting all quota information (the processing is similar as "cat /proc/fs/lustre/qmt/lustre-QMT0000/dt-0x0/glb-usr") from QMT and send it to client.

          Has anyone looked at quota_nld? The linux kernel sends netlink packets about the quota state. 

          simmonsja James A Simmons added a comment - Has anyone looked at quota_nld? The linux kernel sends netlink packets about the quota state. 
          ofaaland Olaf Faaland added a comment -

          Great!

          an interface which try to get all existed quota type record from MDS

          and

          only filter overquota

          Those are the kind of options we have considered and would like your input on.

          Gian-Carlo is extracting the key bits out of a patch he's used for testing, and he'll push that so we can use it to talk about the options.

          ofaaland Olaf Faaland added a comment - Great! an interface which try to get all existed quota type record from MDS and only filter overquota Those are the kind of options we have considered and would like your input on. Gian-Carlo is extracting the key bits out of a patch he's used for testing, and he'll push that so we can use it to talk about the options.

          One of another interesting feature is to add 'lfs quota --list-all' an interface which try to get all existed quota type record from MDS, and even possible passing some flags to MDS(only filter overquota) and then return them back to clients, i heard several times that some people want this, this could save RPCs call for your case(mostly it might be just several RPCs to return back all quota informations).

          wshilong Wang Shilong (Inactive) added a comment - One of another interesting feature is to add 'lfs quota --list-all' an interface which try to get all existed quota type record from MDS, and even possible passing some flags to MDS(only filter overquota) and then return them back to clients, i heard several times that some people want this, this could save RPCs call for your case(mostly it might be just several RPCs to return back all quota informations).
          ofaaland Olaf Faaland added a comment -

          Hongchao, thanks for your response.

          Gian-Carlo is actually asking about an approach for an enhancement he is working on.  He's asking about sending the lquota_entry.lqe_edquot flag back from the QMT to the MDC and through to userspace.

          ofaaland Olaf Faaland added a comment - Hongchao, thanks for your response. Gian-Carlo is actually asking about an approach for an enhancement he is working on.  He's asking about sending the lquota_entry.lqe_edquot flag back from the QMT to the MDC and through to userspace.

          People

            hongchao.zhang Hongchao Zhang
            defazio Gian-Carlo Defazio
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: