You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
INSTRUCTION_UPDATE_METADATA does not update mtime (WAS: fileid) #6629
Whenever mtime or fileid changes on the server (but same etag) the client correctly detects this with INSTRUCTION_UPDATE_METADATA however it does not update the sqlite database.
I have the full debug output in case you want to have a look.
I guest tested to change all the fileid programatically (by editing propertyMapToFileStat in discoveryphase.cpp) and the new file id are properly saved on the database.
Right, we do not synchronize the mtime when only that changes.
This is #4755
We can't just write the mtime to the database, as the mtime in the database must be the LOCAL mtime. We would need to also update the mtime of the file then. (Otherwise, next sync would want to upload the file again) But if only the mtime changes locally, we can't update the mtime on the server as this would change the etag (server bug owncloud/core#20474 ).
So right now we live with the fact that mtimes might differ on the server and on the client.
We could just put the mtime back to the one from the server if we detect the file has not changed, but that's not a better solution IMHO.
But this is quite unrelated from the original issue which was talking about fileid.
changed the title [-]INSTRUCTION_UPDATE_METADATA does not update fileid[/-][+]INSTRUCTION_UPDATE_METADATA does not update mtime (WAS: fileid)[/+]on Jul 4, 2018
Why don't we at least change the local mtime of the file when we detect it changed on the server? This would at least propagate the mtime change in one direction, awaiting the opposite direction until the server bugs are fixed.
That would also fix the problem I am reporting. The current situation is pretty inconsistent and the mtime is quite useless.
Why don't we at least change the local mtime of the file when we detect it changed on the server?
Because then that means that if the user change the mtime locally, the mtime would be reversed back to the server mtime.
If that's the expected behavior, we could implement that.
Note that there is another set of problem when trying to synchronise the mtime.
For example, on timezone change (daylight saving, ....) filesystem which stores the mtime in local time would then cause an update of the mtime of all files.
That would also fix the problem I am reporting. The current situation is pretty inconsistent and the mtime is quite useless.
Can you elaborate what is the problem you have and why you need the mtime to be synchronized.
The problem is the following: when you rename the file locally the rename is propagated OK. However on the next sync run the renamed file is re-uploaded. This is caused by the mtime mismatch between the server and the one stored in the sqlite db -- precisely as illustrated in this case (mtime is different, etag is the same, fileid is also the same).
@moscicki it will be on top of the top far above 2.4.1 --- no backports yet, sorry.
Hope you are not afraid of seeing a prerelease 2.6.0 version number in there :-)
It's at 2.5.0 actually, (not 2.6.0) but yes: still for testing only.
You can choose two different Qt flavors. There should be no functional difference.
For your info: I haven't tested extensively if there are any other side effects of this patch. If you are confident, please include this in 2.4.2 -- that would be great.
OK
client 2.4.3rc1 and client 2.5.0beta1 sync the same file. touch -m the file in either of the clients folders, correctly updates the modify timestamp in the other.
Works both directions. (Had expected that 2.4.3 would not receive the update, but okay)
date --date=@$(sqlite3 ._sync_f3502dd50375.db "select modtime from metadata where path like '%/Example.odt';")
can be used to check the mtime in the client database.
Activity
ogoffart commentedon Jul 2, 2018
What's the client's version?
moscicki commentedon Jul 2, 2018
Version 2.4.1 (build 9367)
ogoffart commentedon Jul 2, 2018
I guest tested to change all the fileid programatically (by editing propertyMapToFileStat in discoveryphase.cpp) and the new file id are properly saved on the database.
I'd like to see a log output.
moscicki commentedon Jul 2, 2018
@ogoffart: I sent the log by private mail.
ogoffart commentedon Jul 2, 2018
The log seems to indicate that the metadata is updated:
We find a lot of these INSERT OR REPLACE INTO metadata, one for every file, and it stores the file id (the 11th parameter)
Is that not saved on the DB?
ogoffart commentedon Jul 3, 2018
So the database is still with the old file id for these files, despite the log claim that it did an INSERT with the right file id?
moscicki commentedon Jul 3, 2018
moscicki commentedon Jul 3, 2018
The writing to the DB works but the client does not use updated mtime value to save to sqlite.
Please consider the case of file:
648e69540d6e9e0b6f8fb0b108678060getlastmodified reported by PROPFIND is 1530200199 (Thu, 28 Jun 2018 15:36:39 GMT)
owncloud.log1:
At local discovery the client has an old mtime value of 1530200212 and old fileid value recorded in the db:
At remote discovery the client detects new mtime 1530200199 and also the new file_id which is now: 628960647970816
And it actually writes the new fileid to disk but old mtime:
ogoffart commentedon Jul 4, 2018
Right, we do not synchronize the mtime when only that changes.
This is #4755
We can't just write the mtime to the database, as the mtime in the database must be the LOCAL mtime. We would need to also update the mtime of the file then. (Otherwise, next sync would want to upload the file again) But if only the mtime changes locally, we can't update the mtime on the server as this would change the etag (server bug owncloud/core#20474 ).
So right now we live with the fact that mtimes might differ on the server and on the client.
We could just put the mtime back to the one from the server if we detect the file has not changed, but that's not a better solution IMHO.
But this is quite unrelated from the original issue which was talking about fileid.
[-]INSTRUCTION_UPDATE_METADATA does not update fileid[/-][+]INSTRUCTION_UPDATE_METADATA does not update mtime (WAS: fileid)[/+]moscicki commentedon Jul 4, 2018
Ok, I changed the subject as it was misleading.
Why don't we at least change the local mtime of the file when we detect it changed on the server? This would at least propagate the mtime change in one direction, awaiting the opposite direction until the server bugs are fixed.
That would also fix the problem I am reporting. The current situation is pretty inconsistent and the mtime is quite useless.
ogoffart commentedon Jul 4, 2018
Because then that means that if the user change the mtime locally, the mtime would be reversed back to the server mtime.
If that's the expected behavior, we could implement that.
Note that there is another set of problem when trying to synchronise the mtime.
For example, on timezone change (daylight saving, ....) filesystem which stores the mtime in local time would then cause an update of the mtime of all files.
Can you elaborate what is the problem you have and why you need the mtime to be synchronized.
moscicki commentedon Jul 4, 2018
The problem is the following: when you rename the file locally the rename is propagated OK. However on the next sync run the renamed file is re-uploaded. This is caused by the mtime mismatch between the server and the one stored in the sqlite db -- precisely as illustrated in this case (mtime is different, etag is the same, fileid is also the same).
ogoffart commentedon Jul 4, 2018
The rename problem would be another issue. Normaly on rename, the mtime should stay the local mtime. If not, this is a bug.
12 remaining items
jnweiger commentedon Jul 5, 2018
@moscicki it will be on top of the top far above 2.4.1 --- no backports yet, sorry.
Hope you are not afraid of seeing a prerelease 2.6.0 version number in there :-)
I'll start with a testpilotcloud client build.
moscicki commentedon Jul 5, 2018
jnweiger commentedon Jul 5, 2018
It's at 2.5.0 actually, (not 2.6.0) but yes: still for testing only.
You can choose two different Qt flavors. There should be no functional difference.
same wrapped as a tar:
guruz commentedon Jul 5, 2018
@moscicki Thanks for testing. Let us know the result asap so we can still get this in 2.4.2
jnweiger commentedon Jul 5, 2018
@guruz what is the timeline for 2.4.2 --- I'd love to have that included too!
2.4.2RC1 tonight.
moscicki commentedon Jul 5, 2018
Hi guys,
Test affirmative - the rename bug is gone.
For your info: I haven't tested extensively if there are any other side effects of this patch. If you are confident, please include this in 2.4.2 -- that would be great.
Thanks for the great job!
Reconcile: When detecting a local move, keep the local mtime
Reconcile: When detecting a local move, keep the local mtime
Reconcile: When detecting a local move, keep the local mtime
ogoffart commentedon Jul 5, 2018
Closing this. Remaining issue with synchronizing mtime is tracked in #4755 and the original issue about fileid was apparently invalid.
moscicki commentedon Jul 6, 2018
Thanks a lot!
jnweiger commentedon Aug 10, 2018
OK
client 2.4.3rc1 and client 2.5.0beta1 sync the same file. touch -m the file in either of the clients folders, correctly updates the modify timestamp in the other.
Works both directions. (Had expected that 2.4.3 would not receive the update, but okay)
date --date=@$(sqlite3 ._sync_f3502dd50375.db "select modtime from metadata where path like '%/Example.odt';")can be used to check the mtime in the client database.
guruz commentedon Aug 10, 2018
Cool date+sqlite3 command :)
Reconcile: When detecting a local move, keep the local mtime