Skip to content

[7.0.3RC2] Restoring folder from trashbin resets ALL etags #11932

Closed

Description

@PVince81

Steps to reproduce

  1. Enable encryption (I had it enabled, unconfirmed)
  2. Create a folder "abc"
  3. Create a non-empty file "test.txt"
  4. Check the etag from "test.txt" in the database
  5. Delete "abc".
  6. Check the etag from "test.txt" in the database
  7. Restore "abc" from the trashbin
  8. Check the etag from "test.txt" in the database

Expected result

The etag of "test.txt" never changes.

Actual result

The etag of "test.txt" changes after step 7, the restoration of abc

This also happens if "test.txt" is inside subfolders and the deleted/restored folder is also in a subfolder

Versions

ownCloud 7 stable7 (38783b1)

CC @schiesbn @icewind1991

Will investigate further.

Activity

  1. self-assigned this
    on Nov 4, 2014
  2. added this to the milestone on Nov 4, 2014
  3. PVince81 commented on Nov 4, 2014

    @PVince81
    ContributorAuthor

    Happens in restoreVersions from the trashbin.

    I'll later have further tests to make sure that reverting single versions also doesn't cause etag troubles.

  4. PVince81 commented on Nov 4, 2014

    @PVince81
    ContributorAuthor

    From what I see from debugging, the file scanner is triggered on the storage root here:
    https://github.com/owncloud/core/blob/master/apps/files_trashbin/lib/trashbin.php#L936

    @icewind1991 @schiesbn do we still need this rescanning ?

    I'll continue debugging, I'd expect this call to NOT reset the etags.

  5. PVince81 commented on Nov 4, 2014

    @PVince81
    ContributorAuthor

    It looks like $reuse is false by default, so that scanning command will reset all etags...
    So the fix is either to tell it to keep the etags or remove the scanning completely.

    I'll grep the code for other such occurrences.

  6. schiessle commented on Nov 4, 2014

    @schiessle
    Contributor

    hm, I'm not sure about the reason for this re-scan. It was introduced by @butonic 0254a3c for object storages compatibility.

  7. PVince81 commented on Nov 4, 2014

    @PVince81
    ContributorAuthor

    Hmm, rescanning the versions should then run the scanner on "files_versions", not on the root.

  8. PVince81 commented on Nov 4, 2014

    @PVince81
    ContributorAuthor

    It looks like the scanner isn't even achieving its purpose.
    I've noticed that after restoring a file, its versions files are restored properly, but the file cache still shows the versions as being in the trasbhin. The rescanning should have corrected this.

  9. PVince81 commented on Nov 4, 2014

    @PVince81
    ContributorAuthor

    I'll provide a quickfix and raise another ticket to fix the cache inconsistency.

  10. PVince81 commented on Nov 4, 2014

    @PVince81
    ContributorAuthor

    Quickfix is here: #11934

  11. PVince81 commented on Nov 4, 2014

    @PVince81
    ContributorAuthor

    Raised inconsistency ticket here: #11935

  12. butonic commented on Nov 4, 2014

    @butonic
    Contributor

    @schiesbn @PVince81 scanning files_trashbin seems to be the right thing to do. I was wrongly under the impression that the scanner would be limited to the view (which is for files_trashbin).

  13. PVince81 commented on Nov 4, 2014

    @PVince81
    ContributorAuthor

    Yes, that's what I suspected. Maybe views should be made to always be root views and not allow chrooting.

  14. PVince81 commented on Nov 6, 2014

    @PVince81
    ContributorAuthor

    I have observed that the following operations will also trigger the bogus rescan:

    1. Delete a file from inside the trashbin
    2. Expire file from the trashbin (by uploading new files when trashbin side > 50% of quota storage)
  15. locked as resolved and limited conversation to collaborators on Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions