mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
lib/fs: properly handle stale NFS file handle
error during file deletion
This error can appear when -storageDataPath points to NFS volume and the given file has been already removed.
This commit is contained in:
parent
9fa2632ac3
commit
8683ea85e6
2 changed files with 7 additions and 1 deletions
|
@ -22,6 +22,7 @@
|
|||
* BUGFIX: reduce the probability of `duplicate time series` errors when querying Kubernetes metrics.
|
||||
* BUGFIX: properly calculate `histogram_quantile()` over time series with only a single non-zero bucket with `{le="+Inf"}`. Previously `NaN` was returned, now the value for the last bucket before `{le="+Inf"}` is returned like Prometheus does.
|
||||
* BUGFIX: vmselect: do not cache partial query results on timeout when receiving data from `vmstorage` nodes. See https://github.com/VictoriaMetrics/VictoriaMetrics/pull/1085
|
||||
* BUGFIX: properly handle `stale NFS file handle` error.
|
||||
|
||||
|
||||
# [v1.54.1](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.54.1)
|
||||
|
|
|
@ -13,7 +13,7 @@ import (
|
|||
|
||||
func mustRemoveAll(path string, done func()) bool {
|
||||
err := os.RemoveAll(path)
|
||||
if err == nil {
|
||||
if err == nil || isStaleNFSFileHandleError(err) {
|
||||
// Make sure the parent directory doesn't contain references
|
||||
// to the current directory.
|
||||
mustSyncParentDirIfExists(path)
|
||||
|
@ -87,6 +87,11 @@ func dirRemover() {
|
|||
}
|
||||
}
|
||||
|
||||
func isStaleNFSFileHandleError(err error) bool {
|
||||
errStr := err.Error()
|
||||
return strings.Contains(errStr, "stale NFS file handle")
|
||||
}
|
||||
|
||||
func isTemporaryNFSError(err error) bool {
|
||||
// See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/61 for details.
|
||||
errStr := err.Error()
|
||||
|
|
Loading…
Reference in a new issue