Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files added to other users shared folder does not count immediately #14596

Closed
luizluca opened this issue Feb 27, 2015 · 24 comments
Closed

Files added to other users shared folder does not count immediately #14596

luizluca opened this issue Feb 27, 2015 · 24 comments

Comments

@luizluca
Copy link

Hello

I'm having problems with OC8.0 regard the quota with shared folders. Files added to other user's shared folder does not count until I manually rescan the folder.

What happens:

  1. create user A with 100MB
  2. create user B with 1000MB
  3. user A creates folder F
  4. user A shares folder F with user B
  5. user A adds 10MB of files to folder F (its quota uses 10MB)
  6. user B adds 50MB of files to folder F (not its quota nor user A quota is used)
    6a. Acoording to past OC doc, A should have its quota used (https://doc.owncloud.org/server/6.0/user_manual/files/quota.html), and this is what I wanted
    6b. Acoording to OC8.0 doc, B should have its quota used (https://doc.owncloud.org/server/8.0/user_manual/files/quota.html)
  7. user B adds 50MB of files to folder F (not its quota nor user A quota is used)

The expected result would be:
6a. user B adds 50MB of files to folder F (user A quota is used)
or
6b. user B adds 50MB of files to folder F (user B quota is used)

In case of 6a:
7. user B adds 50MB of files to folder F. Fails with over quota usage

If I trigger a file-scan manually for user A (./occ files:scan --path="/A/"), its quota is updated correctly according to 6a (not 6b) (It is not what docs say but I guess it makes a little more sense).
If 7. is retried after the rescan, it recieves an over quota error.

The same problem of not updating user A quota happens when user B removes a file from folder F.

It seems that, at least, the quota checking is correct. At step 6., if user try to upload 100MB, OC avoids telling that there is not enough space. However, I can upload less than 90MB multiple times as user A quota is not updated.

@PVince81
Copy link
Contributor

PVince81 commented Mar 1, 2015

Do you have a very deep folder structure ?

Normally upon file upload, the size is updated for every parent folder up to the "files" folder in the database (you can check it in oc_filecache where path = 'files').

Maybe in your case something is delaying that update.
Did you find anything in owncloud.log, potential errors that might have aborted the size propagation ?

@nickvergessen
Copy link
Contributor

Can you also post your error log and owncloud log? Maybe they contain related stuff

@nickvergessen
Copy link
Contributor

@PVince81 related to #14516 ? Could be the same issue, no?

@luizluca
Copy link
Author

luizluca commented Mar 2, 2015

error.log:

[Mon Mar 02 17:44:51.618520 2015] [authz_core:error] [pid 26827] [client 10.9.7.157:38121] AH01630: client denied by server configuration: /srv/www/htdocs/owncloud/data/htaccesstest.txt
[Mon Mar 02 17:48:16.543558 2015] [authz_core:error] [pid 4192] [client 10.9.7.157:38482] AH01630: client denied by server configuration: /srv/www/htdocs/owncloud/data/htaccesstest.txt
(repeated many times)

owncloud.log (during the upload of two files):

{"reqId":"54822935002afb795129968c0c2823fd","remoteAddr":"10.9.200.2","app":"lock","message":"INFO: Write lock requested for \/srv\/www\/htdocs\/owncloud\/data\/_csit-scd\/files\/csit-scd\/Faixa 05.flac","level":0,"time":"2015-03-02T21:03:37+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"54822935002afb795129968c0c2823fd","remoteAddr":"10.9.200.2","app":"lock","message":"PASS: Write lock succeeded on \/srv\/www\/htdocs\/owncloud\/data\/_csit-scd\/files\/csit-scd\/Faixa 05.flac","level":0,"time":"2015-03-02T21:03:37+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"54822935002afb795129968c0c2823fd","remoteAddr":"10.9.200.2","app":"lock","message":"INFO: Incrementing lock type 2 count for \/srv\/www\/htdocs\/owncloud\/data\/_csit-scd\/files\/csit-scd\/Faixa 05.flac","level":0,"time":"2015-03-02T21:03:37+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"54822935002afb795129968c0c2823fd","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user eron. Path does not exists","level":0,"time":"2015-03-02T21:03:38+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"54822935002afb795129968c0c2823fd","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user joaoal. Path does not exists","level":0,"time":"2015-03-02T21:03:38+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"54822935002afb795129968c0c2823fd","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user mossmann. Path does not exists","level":0,"time":"2015-03-02T21:03:38+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"54822935002afb795129968c0c2823fd","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user reyel. Path does not exists","level":0,"time":"2015-03-02T21:03:38+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"54822935002afb795129968c0c2823fd","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user slmoser. Path does not exists","level":0,"time":"2015-03-02T21:03:38+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"54822935002afb795129968c0c2823fd","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user eron. Path does not exists","level":0,"time":"2015-03-02T21:03:38+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"54822935002afb795129968c0c2823fd","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user joaoal. Path does not exists","level":0,"time":"2015-03-02T21:03:38+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"54822935002afb795129968c0c2823fd","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user mossmann. Path does not exists","level":0,"time":"2015-03-02T21:03:38+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"54822935002afb795129968c0c2823fd","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user reyel. Path does not exists","level":0,"time":"2015-03-02T21:03:38+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"54822935002afb795129968c0c2823fd","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user slmoser. Path does not exists","level":0,"time":"2015-03-02T21:03:38+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"53c6811e3659708cb89bbac0a456a365","remoteAddr":"10.9.200.2","app":"lock","message":"INFO: Write lock requested for \/srv\/www\/htdocs\/owncloud\/data\/_csit-scd\/files\/csit-scd\/Faixa 06.flac","level":0,"time":"2015-03-02T21:03:38+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"53c6811e3659708cb89bbac0a456a365","remoteAddr":"10.9.200.2","app":"lock","message":"PASS: Write lock succeeded on \/srv\/www\/htdocs\/owncloud\/data\/_csit-scd\/files\/csit-scd\/Faixa 06.flac","level":0,"time":"2015-03-02T21:03:38+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"53c6811e3659708cb89bbac0a456a365","remoteAddr":"10.9.200.2","app":"lock","message":"INFO: Incrementing lock type 2 count for \/srv\/www\/htdocs\/owncloud\/data\/_csit-scd\/files\/csit-scd\/Faixa 06.flac","level":0,"time":"2015-03-02T21:03:38+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"53c6811e3659708cb89bbac0a456a365","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user eron. Path does not exists","level":0,"time":"2015-03-02T21:03:39+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"53c6811e3659708cb89bbac0a456a365","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user joaoal. Path does not exists","level":0,"time":"2015-03-02T21:03:39+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"53c6811e3659708cb89bbac0a456a365","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user mossmann. Path does not exists","level":0,"time":"2015-03-02T21:03:39+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"53c6811e3659708cb89bbac0a456a365","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user reyel. Path does not exists","level":0,"time":"2015-03-02T21:03:39+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"53c6811e3659708cb89bbac0a456a365","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user slmoser. Path does not exists","level":0,"time":"2015-03-02T21:03:39+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"53c6811e3659708cb89bbac0a456a365","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user eron. Path does not exists","level":0,"time":"2015-03-02T21:03:39+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"53c6811e3659708cb89bbac0a456a365","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user joaoal. Path does not exists","level":0,"time":"2015-03-02T21:03:39+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"53c6811e3659708cb89bbac0a456a365","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user mossmann. Path does not exists","level":0,"time":"2015-03-02T21:03:39+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"53c6811e3659708cb89bbac0a456a365","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user reyel. Path does not exists","level":0,"time":"2015-03-02T21:03:39+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"53c6811e3659708cb89bbac0a456a365","remoteAddr":"10.9.200.2","app":"files_sharing","message":"can not update etags on \/files\/ for user slmoser. Path does not exists","level":0,"time":"2015-03-02T21:03:39+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}

All users mentioned in "can not update etags on /files/ for user xxxx" are users in LDAP who did not already logged into owncloud.

@luizluca
Copy link
Author

luizluca commented Mar 2, 2015

BTW, I can trigger the "quota update" adding a new folder (anywhere) as the user that shares the directory.

@luizluca
Copy link
Author

luizluca commented Mar 2, 2015

If you point me where in OC code it should update the user quota info, I can debug it myself.

@PVince81
Copy link
Contributor

PVince81 commented Mar 3, 2015

Hmmm that is a strange set of errors...

The code that updates the "size" for all files, which is used for the used space calculation, is here: https://github.com/owncloud/core/blob/master/lib/private/files/cache/cache.php#L597

@luizluca
Copy link
Author

luizluca commented Mar 3, 2015

Got a debugger running :-)

It seems that oc_filecache is updated as expected. The problem is only with the sharer quota calculation. Where is the user quota updated?

Initial:
 fileid | storage |      path      |            path_hash             | parent |   name   | mimetype | mimepart | size |   mtime    | storage_mtime | encrypted | unencrypted_size |     etag      | permissions 
--------+---------+----------------+----------------------------------+--------+----------+----------+----------+------+------------+---------------+-----------+------------------+---------------+-------------
    701 |      49 | files/csit-scd | 392de4c929ac439efbd31ebce5cd4af0 |    693 | csit-scd |        2 |        1 |    0 | 1425418901 |    1425418901 |         0 |                0 | 54f62a959359b |          31

user1_quota = 2.4M

event: user2 add /files/csit-scd/Faixa 01.flac (22.837.674 bytes)

 fileid | storage |             path             |            path_hash             | parent |     name      | mimetype | mimepart | size |   mtime    | storage_mtime | encrypted | unencrypted_size |               etag               | permissions 
--------+---------+------------------------------+----------------------------------+--------+---------------+----------+----------+------+------------+---------------+-----------+------------------+----------------------------------+-------------
    912 |      49 | files/csit-scd/Faixa 01.flac | 52a23a49935317fe5400c83e670461c7 |    701 | Faixa 01.flac |       22 |       16 |    0 | 1425419844 |    1425419844 |         0 |                0 | fd4dccaa63bdeb32374c124fe2efaec1 |          27
    701 |      49 | files/csit-scd               | 392de4c929ac439efbd31ebce5cd4af0 |    693 | csit-scd      |        2 |        1 |    0 | 1425419844 |    1425419844 |         0 |                0 | 54f62e33e8e28    

# from correctFolderSize, first ref
(1st call) calculateFolderSize ($path = files/csit-scd/Faixa 01.flac, $entry = null)
 - nothing happens as it is not a folder

# from correctFolderSize, second ref
(2st call) calculateFolderSize ($path = files/csit-scd, $entry = ...)
- nothing update as file size is still 0 in DB

(3rd call) calculateFolderSize ($path = files/csit-scd/Faixa 01.flac, $entry = null)
- nothing happens as it is not a folder

 fileid | storage |             path             |            path_hash             | parent |     name      | mimetype | mimepart |   size   |   mtime    | storage_mtime | encrypted | unencrypted_size |               etag               | permissions 
--------+---------+------------------------------+----------------------------------+--------+---------------+----------+----------+----------+------------+---------------+-----------+------------------+----------------------------------+-------------
    912 |      49 | files/csit-scd/Faixa 01.flac | 52a23a49935317fe5400c83e670461c7 |    701 | Faixa 01.flac |       22 |       16 | 22837674 | 1425419902 |    1425419902 |         0 |                0 | 93b62906a770f19a2c2ea465003bbaa0 |          27
    701 |      49 | files/csit-scd               | 392de4c929ac439efbd31ebce5cd4af0 |    693 | csit-scd      |        2 |        1 |        0 | 1425419844 |    1425419844 |         0 |                0 | 54f62e7e46ca4                    |          31
(2 registros)


(4th call) calculateFolderSize ($path = files/csit-scd, $entry = ...)
  called $this->updated(912,22837674)

 fileid | storage |             path             |            path_hash             | parent |     name      | mimetype | mimepart |   size   |   mtime    | storage_mtime | encrypted | unencrypted_size |               etag               | permissions 
--------+---------+------------------------------+----------------------------------+--------+---------------+----------+----------+----------+------------+---------------+-----------+------------------+----------------------------------+-------------
    912 |      49 | files/csit-scd/Faixa 01.flac | 52a23a49935317fe5400c83e670461c7 |    701 | Faixa 01.flac |       22 |       16 | 22837674 | 1425419902 |    1425419902 |         0 |                0 | 93b62906a770f19a2c2ea465003bbaa0 |          27
    701 |      49 | files/csit-scd               | 392de4c929ac439efbd31ebce5cd4af0 |    693 | csit-scd      |        2 |        1 | 22837674 | 1425420044 |    1425419844 |         0 |                0 | 54f62f0c07195      

user1_quota = 2.4M (still)

@PVince81
Copy link
Contributor

PVince81 commented Mar 4, 2015

@luizluca the usage space of "user1" is calculated by looking at the size of the "files" entry (path = 'files') in the database. Then take the user's quota from the users page that was set by the admin and substract. So "free_space = quota_from_the_users_page - usage_space".

@luizluca
Copy link
Author

luizluca commented Mar 4, 2015

@PVince81 , I though that files might hold the user used space after I was going home... :-)

So, I guess I discovered the problem and I'm starting to ask if ever it worked in any owncloud setup...

The folder size is updated using this function:

OC\Files\Cache\Cache->correctFolderSize() at /srv/www/htdocs/owncloud/lib/private/files/cache/cache.php:569
    public function correctFolderSize($path, $data = null) {
        $this->calculateFolderSize($path, $data);
        if ($path !== '') {
            $parent = dirname($path);
            if ($parent === '.' or $parent === '/') {
                $parent = '';
            }
            $this->correctFolderSize($parent);
        }
    }

Where calculateFolderSize can be implemented by Cache or its decedents: HomeCache and Shared_Cache (which calls cache::correctFolderSize). Their implementation are correct, as folder size is updated when called.

correctFolderSize updates size for a path and recursively calls itself until path is ''. For a user accessing its own folder, I get these calls:

user1:
correctFolderSize('files/csit-scd/Faixa 01.flac', $data)
correctFolderSize('files/csit-scd', $data)
correctFolderSize('files', $data)
correctFolderSize('', $data)

info: actually, it is all those twice. The first with filesize=0 (file creation?) and the second one with
filesize correct.

While when another user writes to the shared csit-scd folder, I get:

user2:
correctFolderSize('Faixa 01.flac', $data)
correctFolderSize('', $data)

It never goes down the shared folder. So, calculateFolderSize is never called for user1 "files".

I do not see another place in code that does this recursion. and subclasses do not replace correctFolderSize. So, I guess there is no place for files to get updated when user2 is writing.
Maybe there is some kind of hook outside code waiting for a shared folder to be updated and replay the correctFolderSize as user1. However, if it should do, it was never called and neither hit my breakpoint.

@PVince81
Copy link
Contributor

PVince81 commented Mar 4, 2015

Hmm... this used to work in OC 6.

If user2 changes a file that belongs to user1, then the shared storage should propagate the size change to user1's storage.

@PVince81
Copy link
Contributor

PVince81 commented Mar 4, 2015

Also, to make sure there is no misunderstanding: the used space only counts for file owners. So if user1 is the owner of the "csit-csd" folder, then any file modified inside still counts in user1's quota, even if it's user2 accessing it.

@luizluca
Copy link
Author

luizluca commented Mar 4, 2015

Yes, I guess there is no misunderstanding. the problem is that user1 quota is not changed when user2 writes to user1 shared folder.

It is only a propagation problem as any modification in any user1 files by user1 generates the updates until the files folder. At this point, any modification that user2 did inside the shared folder starts to count.

@PVince81
Copy link
Contributor

PVince81 commented Mar 5, 2015

Thanks a lot for your analysis, I need to look into this.

@PVince81
Copy link
Contributor

PVince81 commented Mar 5, 2015

@icewind1991 did anything change in OC 8 in regards to size propagation ?

@PVince81
Copy link
Contributor

PVince81 commented Mar 5, 2015

Steps to reproduce:

  1. Create two users "user1" and "user2"
  2. Login as "user1"
  3. Create a folder "test"
  4. Share "test" with "user2"
  5. Login as "user2"
  6. Upload a big file (ex: 10MB) to "test" (as recipient)
  7. Login as "user1"
  8. Check storage usage on the personal page (do not rely on what is displayed as total in the file list)

Expected: 10 MB used
Actual: 0 MB (or whatever was there before)

@PVince81
Copy link
Contributor

PVince81 commented Mar 5, 2015

Also observed on 7.0.4.

It looks like the size (and etag) propagates only up to the "test" folder, but doesn't reach the "files" entry.

@PVince81
Copy link
Contributor

PVince81 commented Mar 5, 2015

This is the initial situation:

MariaDB [owncloud]> select fileid,storage,path,etag,size from oc_filecache where storage in (3,4) and path like 'files%' order by storage,path;
+--------+---------+-------------------+---------------+------+
| fileid | storage | path              | etag          | size |
+--------+---------+-------------------+---------------+------+
|     10 |       3 | files             | 54f87ca700a8f |  163 |
|     15 |       3 | files/test        | 54f87ee70846a |    0 |
|     11 |       3 | files/welcome.txt | 54f87ca379a7b |  163 |
|     18 |       4 | files             | 54f87ee706406 |  163 |
|     19 |       4 | files/welcome.txt | 54f87cafe6a68 |  163 |
+--------+---------+-------------------+---------------+------+

Now if I upload a file as user2 into "test":

MariaDB [owncloud]> select fileid,storage,path,etag,size from oc_filecache where storage in (3,4) and path like 'files%' order by storage,path;
+--------+---------+----------------------+---------------+-----------+
| fileid | storage | path                 | etag          | size      |
+--------+---------+----------------------+---------------+-----------+
|     10 |       3 | files                | 54f87ca700a8f |       163 |
|     15 |       3 | files/test           | 54f87f748d29f | 126679286 |
|     71 |       3 | files/test/data1.dat | 54f87f7432c59 | 126679286 |
|     11 |       3 | files/welcome.txt    | 54f87ca379a7b |       163 |
|     18 |       4 | files                | 54f87f74ac76d |       163 |
|     19 |       4 | files/welcome.txt    | 54f87cafe6a68 |       163 |
+--------+---------+----------------------+---------------+-----------+

@PVince81
Copy link
Contributor

PVince81 commented Mar 5, 2015

Neither the size nor the etag of the root "files" of the owner was changed.

Testing on OC 6.0.6:

MariaDB [owncloud]> select fileid,storage,path,etag,size from oc_filecache where storage in (3,4) and path like 'files%' order by storage,path;
+--------+---------+-------------------+---------------+------+
| fileid | storage | path              | etag          | size |
+--------+---------+-------------------+---------------+------+
|      8 |       3 | files             | 54f881b246dee |  163 |
|     13 |       3 | files/test        | 54f881b23d31b |    0 |
|      9 |       3 | files/welcome.txt | 54f881af01ef2 |  163 |
|     15 |       4 | files             | 54f881b8d5c35 |  163 |
|     16 |       4 | files/welcome.txt | 54f881b8da5fd |  163 |
+--------+---------+-------------------+---------------+------+

After upload:

MariaDB [owncloud]> select fileid,storage,path,etag,size from oc_filecache where storage in (3,4) and path like 'files%' order by storage,path;
+--------+---------+----------------------+---------------+-----------+
| fileid | storage | path                 | etag          | size      |
+--------+---------+----------------------+---------------+-----------+
|      8 |       3 | files                | 54f881d8eb04f | 126679449 |
|     13 |       3 | files/test           | 54f881d8e97f5 | 126679286 |
|     20 |       3 | files/test/data1.dat | 54f881d8c0025 | 126679286 |
|      9 |       3 | files/welcome.txt    | 54f881af01ef2 |       163 |
|     15 |       4 | files                | 54f881b8d5c35 |       163 |
|     16 |       4 | files/welcome.txt    | 54f881b8da5fd |       163 |
+--------+---------+----------------------+---------------+-----------+

AHA! So it worked in OC 6! (CC @guruz)

I was pretty sure I fixed this in OC 6 but the many changes done to the shared folder possibly reintroduced this problem in OC 7...

@PVince81
Copy link
Contributor

PVince81 commented Mar 5, 2015

Another test case with subdirs on stable7. "test" is shared with "user2".
Before:

MariaDB [owncloud]> select fileid,storage,path,etag,size from oc_filecache where storage in (3,4) and path like 'files%' order by storage,path;
+--------+---------+---------------------+---------------+------+
| fileid | storage | path                | etag          | size |
+--------+---------+---------------------+---------------+------+
|     10 |       3 | files               | 54f884fd9c740 |  163 |
|     18 |       3 | files/user1sub      | 54f884fd9d5c3 |    0 |
|     15 |       3 | files/user1sub/test | 54f884f370b66 |    0 |
|     11 |       3 | files/welcome.txt   | 54f884cbdd9cb |  163 |
|     19 |       4 | files               | 54f88506bf10c |  163 |
|     24 |       4 | files/user2sub      | 54f88506bdd3d |    0 |
|     20 |       4 | files/welcome.txt   | 54f88501138a1 |  163 |
+--------+---------+---------------------+---------------+------+

After upload:

MariaDB [owncloud]> select fileid,storage,path,etag,size from oc_filecache where storage in (3,4) and path like 'files%' order by storage,path;
+--------+---------+-------------------------------+---------------+-----------+
| fileid | storage | path                          | etag          | size      |
+--------+---------+-------------------------------+---------------+-----------+
|     10 |       3 | files                         | 54f884fd9c740 |       163 |
|     18 |       3 | files/user1sub                | 54f884fd9d5c3 |         0 |
|     15 |       3 | files/user1sub/test           | 54f88536105ed | 126679286 |
|     25 |       3 | files/user1sub/test/data1.dat | 54f88535cc101 | 126679286 |
|     11 |       3 | files/welcome.txt             | 54f884cbdd9cb |       163 |
|     19 |       4 | files                         | 54f8853629705 |       163 |
|     24 |       4 | files/user2sub                | 54f885362785d |         0 |
|     20 |       4 | files/welcome.txt             | 54f88501138a1 |       163 |
+--------+---------+-------------------------------+---------------+-----------+

Here again we see that the propagation of size+etag stops at the owner's shared folder.

@PVince81
Copy link
Contributor

PVince81 commented Mar 5, 2015

Work in progress here: #14720

@PVince81
Copy link
Contributor

PVince81 commented Mar 6, 2015

I think I'll split the size propagation logic from etag.

The reason is that the size only needs to be propagated to the owner.

But for etags, the change must appear for every recipient! Which is another algorithm...

@PVince81
Copy link
Contributor

PVince81 commented Mar 6, 2015

I raised a separate ticket for the etag propagation to avoid confusion: #14726

Let's keep this ticket here solely for the size propagation.

@MorrisJobke
Copy link
Contributor

Fix was merged: #14720

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants