VictoriaMetrics/lib/fs
Aliaksandr Valialkin 0e3c532bf7
app/vmselect/netstorage: prevent from disk write IO when closing temporary files
Remove temporary file before closing it in order to signal the OS that it shouldn't
store the file contents from page cache to disk when the file is closed.

Gracefully handle the case when the file cannot be removed before being closed -
in this case remove the file after closing it. This allows working on Windows.

Also remove superflouos opening of temporary file for reading - re-use already opened file handle for writing.

This is a follow-up for 9b1e002287
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/4020
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/70
2024-02-01 19:12:44 +02:00
..
fscore all: allow dynamically reading *AuthKey flag values from files and urls 2024-01-21 22:03:38 +02:00
dir_remover.go lib/mergeset: atomically remove part dirs 2022-09-13 16:17:38 +03:00
fadvise_darwin.go app/vmselect/promql: follow-up for ce4f26db02 2024-01-16 02:55:08 +02:00
fadvise_openbsd.go app/vmselect: reduce memory usage when query touches big number of time series 2020-11-04 17:04:04 +02:00
fadvise_solaris.go fixes solaris build (#1345) 2021-05-31 09:21:23 +03:00
fadvise_unix.go all: cleanup: remove // +build ... lines, since they are no longer needed after Go1.17, and the minimum supported Go version for VictoriaMetrics source code is Go1.20 2023-11-13 19:12:51 +01:00
fs_nix.go all: cleanup: remove // +build ... lines, since they are no longer needed after Go1.17, and the minimum supported Go version for VictoriaMetrics source code is Go1.20 2023-11-13 19:12:51 +01:00
fs_openbsd.go lib/fs: move common code outside arch-specific implementations of mustRemoveDirAtomic() 2023-05-08 23:10:20 -07:00
fs_solaris.go lib/fs: move common code outside arch-specific implementations of mustRemoveDirAtomic() 2023-05-08 23:10:20 -07:00
fs_test.go all: allow dynamically reading *AuthKey flag values from files and urls 2024-01-21 22:03:38 +02:00
fs_unix.go all: cleanup: remove // +build ... lines, since they are no longer needed after Go1.17, and the minimum supported Go version for VictoriaMetrics source code is Go1.20 2023-11-13 19:12:51 +01:00
fs_windows.go lib/fs: move common code outside arch-specific implementations of mustRemoveDirAtomic() 2023-05-08 23:10:20 -07:00
fs.go all: allow dynamically reading *AuthKey flag values from files and urls 2024-01-21 22:03:38 +02:00
reader_at_test.go all: use os.{Read|Write}File instead of ioutil.{Read|Write}File 2022-08-21 23:52:35 +03:00
reader_at_timing_test.go all: use os.{Read|Write}File instead of ioutil.{Read|Write}File 2022-08-21 23:52:35 +03:00
reader_at.go app/vmselect/netstorage: prevent from disk write IO when closing temporary files 2024-02-01 19:12:44 +02:00