stacksync / sync-service

[DISCONTINUED] StackSync's synchronization service
Apache License 2.0
55 stars 15 forks source link

Incorrect quota calculation #10

Open ashish-kale opened 9 years ago

ashish-kale commented 9 years ago

For a "shared" folder , the quota is increased many times.

  1. When the file is originally uploaded.
  2. When the file is synced by other clients. Thus , if the file which is shared is downloaded "N" times , the quota is increased in multiples of N+1's times the file size.

Also, the "quota_used_real" field in "user1" table is always 0. Is this expected behavior?

Also, getting follow error in logs:- ERROR PostgresqlDAO:65 - org.postgresql.util.PSQLException: ERROR: value too long for type character varying(100)
ERROR Handler:603 - com.stacksync.syncservice.exceptions.dao.DAOException: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(100)
ERROR SyncServiceImp:117 - java.lang.NullPointerException

Can you please provide pointers to solve these errors?

Cotes commented 9 years ago

Hi Ashish,

The first error is quite weird and difficult to reproduce in our test environment. The only thing that come to my mind is that it can be related with the issue https://github.com/stacksync/desktop/issues/13. Possibly, when the desktop client throws the error parsing exception, it re-indexes the file and re-uploads the metadata.

The param "quota_used_real" should be modified when a file is updated. If it is always 0 is because the swift-stacksync-quota (https://github.com/stacksync/swift-stacksync-quota) is not activated. I think that it is activated in the VM that we provide.

The last error is because we are trying to insert in the database a string value with more than 100 characters. To solve this problem temporary, you could change the database. Normally this error is related with the mimetype or the filename.

Cristian.