Skip to content

[6.0.3] Files uploaded directly to SWIFT storage don't show up in oC #8633

Closed

Description

@ser72

Steps

  1. configure External Storage as SWIFT
  2. Upload a file directly to the SWIFT storage -- not through oC
  3. View SWIFT directory in oC and the file from Step 2 isn't there:

IMAGES
Swift storage -- the last file is uploaded directly to SWIFT. The other 2 were uploaded via oC.

bouquet_contents_missing_file

oC. Notice the missing file
capture

Activity

  1. PVince81 commented on May 19, 2014

    @PVince81
    Contributor

    As discussed, might be an issue with the mtime of the SWIFT root.
    From what I remember seeing is that the root mtime is always the "creation time of the bucket" and it never updates itself.
    We might need to find another way to detect changes there.

  2. PVince81 commented on May 19, 2014

    @PVince81
    Contributor
  3. icewind1991 commented on May 19, 2014

    @icewind1991
    Contributor

    iirc we decided not to support this use case for the swift backends since swift doesn't handle nested directories itself and thus we need to emulate it by storing additional meta-data

  4. PVince81 commented on May 19, 2014

    @PVince81
    Contributor

    I checked the other headers and haven't found yet how to detect whether ANY change has been done on the SWIFT server.

    As for the directory structure, the only thing that isn't emulated is the propagation of mtime from a subdirectory to parent directories. This would be an additional issue.

  5. PVince81 commented on May 19, 2014

    @PVince81
    Contributor

    Looking through the docs I have the feeling that it's not possible to get a timestamp or date for the bucket itself (the root).

    The alternative would be to do a full rescan, or a cron job, or something that would sync it.

    As for the scanning, we might be able to use range requests on the object list. I saw in the API that it's possible to retrieve the list in a paginated manner. The scanner wouldn't need to make calls for every subdir but just take the whole list at once... still might not be good for performance and memory. Also might be a much bigger change.

    I'll continue my research.

  6. PVince81 commented on May 19, 2014

    @PVince81
    Contributor

    I've asked on IRC #openstack-swift and was told that it isn't currently possible.
    They suggested reload the whole list and comparing the mtimes to the known ones, which is inconvenient.
    And then, they said it would be cool if it was possible to sort results (the object list) by mtime, which isn't possible at the moment.

  7. PVince81 commented on May 19, 2014

    @PVince81
    Contributor

    I was suggested to write a SWIFT middleware that would detect changes on the server (not sure how) and then send notifications.
    If that would be possible, it means that after the initial scan we could rely on the notifications to update the file cache. But that seems like a lot of work and not at all a simple solution.

  8. PVince81 commented on May 19, 2014

    @PVince81
    Contributor

    One possible workaround for the mtime issue: provide a "root" field and let users put their files into a specific folders on the SWIFT server. We should be able to detect the mtime of that folder since it has an entry on the object store.
    One prerequisites is however that whichever tool is used to upload files must also automatically update the mtime of the folders, which would make it possible to detect changes from ownCloud.

  9. ser72 commented on May 22, 2014

    @ser72
    Author

    @PVince81

    We created a sub folder in the SWIFT storage in ownCloud
    Then we uploaded a file directly to the SWIFT storage (bypassing ownCloud) in that subfolder
    Going back into ownCloud, the file did not exist.

  10. PVince81 commented on May 22, 2014

    @PVince81
    Contributor

    @ser72 ok, thanks for the info.
    This needs more investigation. I guess it should be at least possible to make the detection work in a subfolder.

  11. PVince81 commented on May 22, 2014

    @PVince81
    Contributor

    I can't test this because the Rackspace UI doesn't accept folders, only files.
    From the screenshot it looks like they are using Nectar, another provider.

    If the folder case doesn't work, it is likely to be because whichever program or UI they use to upload a file, that program doesn't automatically update the folder's mtime, which makes it impossible to detect changes.

    For example, if the object store contains these entries:

    file_in_root.txt
    subdir/
    subdir/file_in_subdir.txt
    

    When uploading a file into the subdir, it will simply add a new entry called "subdir/newfile_in_subdir.txt" and will probably not change the mtime of the "subdir/" entry, which our code checks to find whether there are changes.

    I have the feeling that detecting changes is close to impossible with SWIFT interfaces without resorting to either getting notifications from the object store itself (needs architectural additions / development of object store specific plugins) OR often doing a full rescan.

    Doing a full rescan might be possible but the performance is likely to be very bad.
    A partial rescan could be possible based on the currently accessed folder, but requires checking all files in subfolders. When accessing root, the whole store would be rescanned.

  12. PVince81 commented on May 22, 2014

    @PVince81
    Contributor

    @icewind1991 would it be possible to trigger a rescan specifically for a given storage using a cron job ?

  13. 30 remaining items

  14. butonic commented on Oct 10, 2014

    @butonic
    Contributor

    That is a known limitation of the current implementation. Swift and s3 only emulate directories. As a result the mtime change to a file is not propagated up the directory tree, which we would need to have a cheap way (one http call) to detect changes in the external storage. I see two solutions:

    1. always do a full scan of the external storage when it is accessed
    2. periodically do a full scan of the external storage in the background

    1 is not a viable solution because we have ti iterate over all files in swift/s3 which will take too long to do it on demand
    2. still takes several http calls to iterate over all objects in swift/s3 but will allow for eventual consistency, depending on the rescan frequency..

    Unfortunately 2. comes at a cost for s3 users because they have to pay for the arising traffic. But I still think it is our best bet. Also note that #11375 now makes all users reuse the same filecache for s3 mounts, which makes rescanning unnecessary when all access happens through owncloud.

  15. butonic commented on Oct 10, 2014

    @butonic
    Contributor

    cc @PVince81 @icewind1991 for an opinion on the background scanning of externat swift/s3 storages

  16. PVince81 commented on Oct 13, 2014

    @PVince81
    Contributor

    At some point I asked the openStack guys on IRC and they said one should implement a SWIFT middleware that would detect changes and then notify OC about such. But I have no idea how such a middleware could be written... it is likely that the middleware itself would still need to scan the SWIFT storage to find about changes, unless it's possible to have hooks.

    So for now it seems the only solution is to do a full rescan periodically.

  17. butonic commented on Oct 20, 2014

    @butonic
    Contributor

    @icewind1991 What about a scanner that scans all objects at once, instead of descending the tree. That would certainly improve scan performance on s3 and swift. It could then be executed as a background job or after a configurable timeout. I'll look into it tomorrow, but your input is very welcome!

  18. MorrisJobke commented on Dec 2, 2014

    @MorrisJobke
    Contributor

    Needs additional discussion in #11797

  19. modified the milestones: , backlog on Jan 8, 2015
  20. carlaschroder commented on Jan 29, 2015

    @carlaschroder

    added to release notes

  21. RobinMcCorkell commented on Mar 20, 2015

    @RobinMcCorkell
    Contributor

    Given that release notes have been updated, I'm marking this as a duplicate of #11797

  22. removed this from the backlog milestone on Mar 20, 2015
  23. locked as resolved and limited conversation to collaborators on Aug 12, 2019
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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions