1F - Enforced bucket-level quotas in RGW

Live Pad

The live pad can be found here: [pad]

Summit Snapshot

Coding tasks
  1. Modify bucket metadata structure
  2. Create admin interfaces to modify new bucket metadata info
  3. Enforce limit on the bucket index (hard limit)
  4. Prevent writes to enforced bucket if hard limit exceeded
  5. Implement bucket info cache
  6. Update bucket info periodically for all buckets
  7. Update bucket info synchronously for specific buckets if exceeded soft limit
Documentation tasks
  1. Document new admin interfaces, API
  2. Document semantics


507 Insufficient Storage (WebDAV; RFC 4918) — maybe we can use this for the return code?

The current design has a race condition with the soft quotas, as Li Wang points out. Greg suggests that we could have a post-check on the bucket index return an error code if the user has exceeded their quota, and the gateway can then return an error to the user and schedule the already -uploaded data for immediate garbage collection. (#3) This also means we can implement the soft quota work at a later time to provide an earlier (friendlier) return to clients.

Well, that means we have to do something like rollback? Like the journal file system does?
This is already supported implicitly given the way we do our atomic object switches.