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
handle local disk full properly (affects data integrity) #2939
Currently the client misses on handling of local disk full condition. This causes random crashes and is susceptible to corrupt data (or sync journal).
Client should require some minimal space being available on the disk hosting the sync folder(s) and enter "idle" mode when there is not enough disk space. For example, google drive pauses operation when free disk space is < ~1GB.
For implementation, one may use existing OS APIs, if not provided by Qt. Python example:
def get_free_space_mb(folder):
""" Return folder/drive free space (in bytes)
"""
if platform.system() == 'Windows':
free_bytes = ctypes.c_ulonglong(0)
ctypes.windll.kernel32.GetDiskFreeSpaceExW(ctypes.c_wchar_p(folder), None, None, ctypes.pointer(free_bytes))
return free_bytes.value/1024/1024
else:
st = os.statvfs(folder)
return st.f_bavail * st.f_frsize/1024/1024
This needs some additinal testing on less frequent filesystems (such as Windows DFS).
no activity in sync client, disk usage grows independently of the sync client -> a simple periodic check and a check before starting any update activity could suffice
disk space going low due to the sync client itself performing downloads -> this requires some check integrated into the propagator itself (to pause it, snapshot the state and then resume it at some later stage)...
there could be also a combination of these two factors, in which case a sufficiently high threshold could be enough to cover all real-world scenarios...
if we are really paranoid about zero bytes left and the sync journal we may also foresee to have a placeholder file to book the minimal space required to cleanly shutdown sqlite db (not sure if that's an issue)
I think after the discovery phase (which does not need disk space) we should be able to calculate how much space change need for performing the sync. A decent safety belt can be added and we should be able to estimate if space is sufficient or not.
Notes:
We need to find a efficient, cross platform way of getting the free disk space of the the partition on which the sync directory is located. That might be tricky.
To do it perfectly nice, we would need to do the calculation about the available free space as we sync, as third party processes could eat up the space while we are working. Not sure if that is required...
As a user, I want the desktop client to recognize when the addition of new files and folders added to the server and synced to the desktop will fill the local disk space, to not sync these new folders and files, and to throw a notification of the failure so that the desktop I am using doesn't crash using the desktop client.
Acceptance Criteria:
To start, the desktop client will not attempt to use the last 250MB of free disk space on a client
When the desktop client identifies that new or updated files downloaded from the server will reduce the free space on the desktop to under 250MB, the desktop client will not sync any files from that point forward until the sync run will fall below 250MB
The desktop client will throw a red check mark and the sync run gets a fatal error “The sync client needs to sync XGB/MB of files, but only has room for Y GB/MB. Please free space on the disk before syncing.”
The calculations for the disk size needed includes all meaningful consumers of disk by the client (for example, he temp file)
At a future date, a different algorithm (% of free disk space for example, or a higher disk limit) may be needed.
I believe OWNCLOUD_CRITICAL_FREE_SPACE is in MB. So, if you have 100GB free space on your local disk (=100,000MB) then you have to set:
OWNCLOUD_CRITICAL_FREE_SPACE=100000
(or more)
So that the actual free space on your local disk is less than OWNCLOUD_CRITICAL_FREE_SPACE
Now put some files on the server using the web interface. The client should start to sync and then report that there is not enough space on the local disk.
You might need to increase OWNCLOUD_CRITICAL_FREE_SPACE even more, because it depends how your system measures 737.54 GB - maybe that is 737540 MB or maybe 737.54 * 1024 = 755241 MB - you can make it 800000 to be sure :)
I think you will need to set OWNCLOUD_CRITICAL_FREE_SPACE to a higher number. OWNCLOUD_CRITICAL_FREE_SPACE needs to be bigger than the free space on your local disk.
I tested this issue and finally is working OK for my.
Many thanks to @ckamm and @phil-davis for helping me
Desktop v ownCloud-2.1.0.2865-nightly20151110.pkg
Server v {"installed":true,"maintenance":false,"version":"8.1.4.0","versionstring":"8.1.4 RC1","edition":""}
Activity
dragotin commentedon Mar 10, 2015
I agree, suggest to do it for 1.8.1, @MTRichards
MTRichards commentedon Mar 10, 2015
moscicki commentedon Mar 10, 2015
I though about some cases:
dragotin commentedon Mar 10, 2015
I think after the discovery phase (which does not need disk space) we should be able to calculate how much space change need for performing the sync. A decent safety belt can be added and we should be able to estimate if space is sufficient or not.
Notes:
dragotin commentedon Mar 10, 2015
about 1.: https://github.com/owncloud/client/blob/master/src/libsync/utility.cpp#L173
guruz commentedon May 5, 2015
Related #3144
MTRichards commentedon Sep 2, 2015
As a user, I want the desktop client to recognize when the addition of new files and folders added to the server and synced to the desktop will fill the local disk space, to not sync these new folders and files, and to throw a notification of the failure so that the desktop I am using doesn't crash using the desktop client.
Acceptance Criteria:
30 remaining items
phil-davis commentedon Nov 5, 2015
I believe OWNCLOUD_CRITICAL_FREE_SPACE is in MB. So, if you have 100GB free space on your local disk (=100,000MB) then you have to set:
OWNCLOUD_CRITICAL_FREE_SPACE=100000
(or more)
So that the actual free space on your local disk is less than OWNCLOUD_CRITICAL_FREE_SPACE
Dianafg76 commentedon Nov 6, 2015
My free space on my local i 737.54 GB drive, so I have to set
OWNCLOUD_CRITICAL_FREE_SPACE=737540
And What is the next step?
phil-davis commentedon Nov 6, 2015
Now put some files on the server using the web interface. The client should start to sync and then report that there is not enough space on the local disk.
You might need to increase OWNCLOUD_CRITICAL_FREE_SPACE even more, because it depends how your system measures 737.54 GB - maybe that is 737540 MB or maybe 737.54 * 1024 = 755241 MB - you can make it 800000 to be sure :)
Dianafg76 commentedon Nov 6, 2015
@guruz
CURRENT BEHAVIOR
The client is started to sync and I don't have the report.
I don't have the report that there is not enough space on the local disk
phil-davis commentedon Nov 6, 2015
I think you will need to set OWNCLOUD_CRITICAL_FREE_SPACE to a higher number. OWNCLOUD_CRITICAL_FREE_SPACE needs to be bigger than the free space on your local disk.
ckamm commentedon Nov 10, 2015
@Dianafg76 @phil-davis Actually, OWNCLOUD_CRITICAL_FREE_SPACE is in bytes (also says so here: https://github.com/owncloud/client/wiki/Testing-Scenarios-2.1)
So you want to set it to something like 8589934592 (800GB).
Rename env variables to include unit #2939
ckamm commentedon Nov 10, 2015
@Dianafg76 In new builds these env variables have been renamed to
OWNCLOUD_CRITICAL_FREE_SPACE_BYTESandOWNCLOUD_FREE_SPACEphil-davis commentedon Nov 10, 2015
@ckamm Thanks, from the numbers @Dianafg76 was using at first I just assumed that they were KB - I should read the doc or the code :)
Dianafg76 commentedon Nov 11, 2015
I tested this issue and finally is working OK for my.
Many thanks to @ckamm and @phil-davis for helping me
Desktop v ownCloud-2.1.0.2865-nightly20151110.pkg
Server v {"installed":true,"maintenance":false,"version":"8.1.4.0","versionstring":"8.1.4 RC1","edition":""}
Closed