app/vmagent/remotewrite: cosmetic updates after f3a51e8b1d

- Compare directory names instead of paths to directory when determining which persistent queues must be deleted
  This is less error-prone solution, since paths to the same directory can differ, which could lead
  to accidental directory removal for the existing -remoteWrite.url

- Log the `removed %d dangling queues` message when at least a single queue has been removed

- Consistently use filepath.Join() for creating paths to persistent queues.
  This is needed for Windows support (see https://github.com/VictoriaMetrics/VictoriaMetrics/issues/70 )

- Clarify the description of the change at docs/CHANGELOG.md

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4014
This commit is contained in:
Aliaksandr Valialkin
2023-03-27 18:33:05 -07:00
parent f3a51e8b1d
commit aea6df8197
3 changed files with 15 additions and 12 deletions

View File

@@ -2,6 +2,7 @@ package persistentqueue
import (
"fmt"
"path/filepath"
"sync"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
@@ -201,6 +202,6 @@ func (fq *FastQueue) MustReadBlock(dst []byte) ([]byte, bool) {
}
// Dir returns the directory for persistent queue.
func (fq *FastQueue) Dir() string {
return fq.pq.dir
func (fq *FastQueue) Dirname() string {
return filepath.Base(fq.pq.dir)
}