Skip to content

Per app volatile metadata storage with quota #11963

Closed

Description

@PVince81

The current problem:

  1. User quota only takes file sizes into account (see http://doc.owncloud.org/server/6.0/admin_manual/quota/index.html)
  2. Metadata (trashbin, versions, thumbnails, gallery previews, etc) are NOT counted in the quota
  3. Not all metadata is expiring, for example thumbnails live forever but trashbin/versions are auto-expired when the user is running out of space.

Due to 2) and 3) it can be difficult for an admin to estimate how big the real storage needs to be.
For example if a user has 10 GB quota, they might need 1-2 GB metadata, especially if they have many pictures.

Currently there's a risk of having thumbnails / gallery previews filling up the disk if every user has lots of previews.

To fix this, the idea would be to introduce a volatile metadata storage implementation.
Every app would get an instance of MetadataStore (a new class to be written) which virtually limits its free space to a given % of the quota.

The metadata quota would be additional to the quota.

So for one user "user1" it could look like this:

  1. User quota: 10000 MB
  2. Metadata quota for thumbnails: 10% => 100 MB
  3. Metadata quota for gallery app: 20% => 200 MB
  4. Metadata quota for a third party app X: 5% => 50 MB
  5. Total space allocated for the user: 10350 MB

Every metadata quota storage could provide functions for apps to auto-expire their metadata. Their function "free_space()" would return the available allocated space.

As discussed with @schiesbn @nickvergessen.

CC @icewind1991 @MTRichards @craigpg @karlitschek

Activity

  1. MorrisJobke commented on Jun 2, 2015

    @MorrisJobke
    Contributor

    While thinking about this keep following scenario in mind:

    • there are users with a quota of 0 B
    • they got a folder from a user with a normal quota shared
    • the 0 B quota users delete a file from these shares - with Only use quota stream wrapper on "files" #16613 the trashbin doesn't has any quota anymore
    • the file get immediatly cleaned up, because it reaches more than 50% of the quota (at 0 B this isn't hard ;))
  2. MorrisJobke commented on Jun 3, 2015

    @MorrisJobke
    Contributor

    they got a folder from a user with a normal quota shared

    This could also be an external storage mount, but then there is no way to version files or use the trashbin.

  3. cdamken commented on Jun 8, 2015

    @cdamken
    Contributor

    the file get immediatly cleaned up, because it reaches more than 50% of the quota (at 0 B this isn't hard ;))

    Should not be the deleted file referenced to the owner´s quota and not to the 0 B user quota? is that possible? as long as it is a shared, the owner is the once who owns the quota too.

  4. PVince81 commented on Jun 8, 2015

    @PVince81
    ContributorAuthor

    @cdamken it's not possible because: the file lands in the trashbin of both the owner and recipient. And once the file is in the recipient's trashbin, there is no way to find out that the file originally belonged to the owner. So there is no link that could tell which quota to use.
    Also if we had that info it would mean that every item in the trashbin would have a different quota policy/value, which make things much more complex.

    If one day we decide and manage to have trashbins stored directly on storages, and also "shared trashbins", then it might be a different story.

  5. cdamken commented on Jun 8, 2015

    @cdamken
    Contributor

    @PVince81

    That means that both user has the same file in the trash-bin and both can restore it.
    in a behavior where a user is not 0 B:
    If the owner erases a file from their trash-bin, would it be possible for the shared user to restore it?
    could be possible that the shared user only has a "link" from the erased files?

    If one day we decide and manage to have trashbins stored directly on storages, and also "shared trashbins", then it might be a different story.

    That would be great 👍

  6. PVince81 commented on Jun 8, 2015

    @PVince81
    ContributorAuthor

    It would mean that the deleted file in the recipient's trash is like a shared file, but is "mounted" in the trashbin as for regular shares. This sounds a bit convoluted and maybe too complex, and would probably need architectural changes. But still something to keep in mind.

  7. added this to the backlog milestone on Mar 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions