-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Running influxd.exe backup -portable leaves <x>.tmp folders in data directory on Windows #16289
Comments
@KoosBusters thanks for the issue. My guess is that these get cleaned up eventually and restarting influxdb just kicks that process off sooner. Are these |
@russorat thanks for looking at this issue. We run backups daily for the full database dat and move the backup files to off-site backup location. But the temp folders are never removed during normal operations of the database and are only removed when we restart influxdb. This means that after running for about 2-3 weeks without restart the disk space of the server is running low because all the temp folders/files are several times larger in disk space than the data of the database itself. A restart of influxdb will fix this, but it does mean that we have to restart our production environment at regular intervals. Additional information that might help: We do not have any retention set in influx itself so there is no automatic deletion of any data. So if the temp. cleanup is included in the retention process we might not have this process running in the db. |
run cleanup after snapshot creation if no parallel snapshot is in progress fixes issue influxdata#16289
run cleanup after snapshot creation if no parallel snapshot is in progress fixes issue influxdata#16289
I can confirm that this issue is not Windows-specific, even though it's tagged os/windows. I just got burned by this on an Influx instance running in a Kubernetes cluster on Linux. |
I have the same problem on linux, .tmp directories are not at all cleaned up aafter startup, only restart does. |
Being affected by the issue, I've made some tests and it seems it's fixed in the upcoming 1.8.4 version. |
Release 1.8.5 is supposed to resolve this. but, I've just tested it on Windows server, and it's still the same error/.tmp issue on portable backup. |
@oori - Do you have any logs from the backup you could attach here to help? Thanks! Also, the directory location of the .tmp files would be helpful. |
@davidby-influx thanks for the quick follow up!
|
@oori - So this seems to be either a Windows directory permissions problem, or a file-left-open problem. We have other code where we have to explicitly close files on Windows that Linux permits operations like rename on. The goodish new is that this probably isn't a Linux problem anymore (i.e. our fix was correct algorithmically in finding and trying to delete the files), but only a Windows problem. We will triage this and drop it in the work queue appropriately. |
I think I've got a similar issue on Linux with Influx 1.8.0, but in my case it is NOT a permission problem. Restarting influx did the job! I will upgrade and hope this will work without restarting. |
@sonejostudios - this has been fixed on Linux for 1.8.5 and later builds. |
@davidby-influx Ok, thanks for the info! I upgraded to 1.8.9 but got a starting script issue which I could solve with this thread: https://community.influxdata.com/t/influxdb-1-8-7-will-not-start/20965/25 |
See also #16289 |
See also #21470 which has a potential suggested fix |
@lesam - Is the delete failure of the snapshot hard links is because the file is still open through the original locations by the Influx engine? In Windows, See here for a discussion of FILE_SHARE_DELETE support in Go (tldr; not likely anytime soon). |
@lesam and I discussed options to fix this, as well as other problems that this may be causing. For instance, this may cause deletion failures when the compactor attempts to delete a file that is also linked in a temp directory and opened by backup. Initially brainstormed options to fix this:
|
Thinking aloud: The second option above, returning open file handles, will require modifications to the Influxdata |
@lesam - Evaluation of the options:
|
On Windows, make copies of files for snapshots, because Go does not support the FILE_SHARE_DELETE flag which allows files (and links) to be deleted while open. This causes temporary directories to be left behind after backups. closes #16289
On Windows, make copies of files for snapshots, because Go does not support the FILE_SHARE_DELETE flag which allows files (and links) to be deleted while open. This causes temporary directories to be left behind after backups. closes #16289
On Windows, make copies of files for snapshots, because Go does not support the FILE_SHARE_DELETE flag which allows files (and links) to be deleted while open. This causes temporary directories to be left behind after backups. closes #16289
On Windows, make copies of files for snapshots, because Go does not support the FILE_SHARE_DELETE flag which allows files (and links) to be deleted while open. This causes temporary directories to be left behind after backups. closes #16289
On Windows, make copies of files for snapshots, because Go does not support the FILE_SHARE_DELETE flag which allows files (and links) to be deleted while open. This causes temporary directories to be left behind after backups. closes #16289
fix(restore): enforce the -db parameter when -newdb used closes #15901 (cherry picked from commit 1dde65b) closes #22560 fix: for Windows, copy snapshot files being backed up On Windows, make copies of files for snapshots, because Go does not support the FILE_SHARE_DELETE flag which allows files (and links) to be deleted while open. This causes temporary directories to be left behind after backups. closes #16289 (cherry picked from commit 3702fe8) closes #22559
On Windows, make copies of files for snapshots, because Go does not support the FILE_SHARE_DELETE flag which allows files (and links) to be deleted while open. This causes temporary directories to be left behind after backups. closes #16289 (cherry picked from commit 3702fe8) closes #22557 (cherry picked from commit 47007f6)
fix(restore): enforce the -db parameter when -newdb used closes #15901 (cherry picked from commit 1dde65b) closes #22560 fix: for Windows, copy snapshot files being backed up On Windows, make copies of files for snapshots, because Go does not support the FILE_SHARE_DELETE flag which allows files (and links) to be deleted while open. This causes temporary directories to be left behind after backups. closes #16289 (cherry picked from commit 3702fe8) closes #22559
… (#22563) On Windows, make copies of files for snapshots, because Go does not support the FILE_SHARE_DELETE flag which allows files (and links) to be deleted while open. This causes temporary directories to be left behind after backups. closes #16289 (cherry picked from commit 3702fe8) closes #22557 (cherry picked from commit 47007f6) closes #22558
Steps to reproduce:
List the minimal actions needed to reproduce the behavior.
influxd.exe backup -portable c:\backupdir
Expected behavior:
A backup of Influxdb in the c:\backupdir
Actual behavior:
A backup of Influxdb in the c:\backupdir, but also x.tmp folders in the "data" directory.
x increases for each backup you run.
The x.tmp folders contain a copy of the tsm files.
You cannot delete these folders while Influxdb is running (files are in use).
When you restart Influxdb the folders are automatically cleaned/removed.
The text was updated successfully, but these errors were encountered: