From 15bc40216ddccb0f2643638d679ff879362fc466 Mon Sep 17 00:00:00 2001 From: Dmytro Kozlov Date: Wed, 16 Aug 2023 14:54:51 +0200 Subject: [PATCH] app/vmctl: fix migration process if tenant have no data (#4799) app/vmctl: don't interrupt migration process if tenant has no data Signed-off-by: hagen1778 Co-authored-by: Alexander Marshalov <_@marshalov.org> (cherry picked from commit 39623ae4284661648ca11d53934ecf99090c00ea) --- app/vmctl/vm_native.go | 7 ++++++- docs/CHANGELOG.md | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/vmctl/vm_native.go b/app/vmctl/vm_native.go index 8d94d2bbe..31bdb6b38 100644 --- a/app/vmctl/vm_native.go +++ b/app/vmctl/vm_native.go @@ -201,7 +201,12 @@ func (p *vmNativeProcessor) runBackfilling(ctx context.Context, tenantID string, } if len(metrics) == 0 { - return fmt.Errorf("no metrics found") + errMsg := "no metrics found" + if tenantID != "" { + errMsg = fmt.Sprintf("%s for tenant id: %s", errMsg, tenantID) + } + log.Println(errMsg) + return nil } foundSeriesMsg = fmt.Sprintf("Found %d metrics to import", len(metrics)) } diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index eaeb37ea4..37b965509 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -31,6 +31,7 @@ The following `tip` changes can be tested by building VictoriaMetrics components * BUGFIX: properly replace `:` chars in label names with `_` when `-usePromCompatibleNaming` command-line flag is passed to `vmagent`, `vminsert` or single-node VictoriaMetrics. This addresses [this comment](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3113#issuecomment-1275077071). * BUGFIX: [Official Grafana dashboards for VictoriaMetrics](https://grafana.com/orgs/victoriametrics): fix display of ingested rows rate for `Samples ingested/s` and `Samples rate` panels for vmagent's dasbhoard. Previously, not all ingested protocols were accounted in these panels. An extra panel `Rows rate` was added to `Ingestion` section to display the split for rows ingested rate by protocol. * BUGFIX: [vmbackup](https://docs.victoriametrics.com/vmbackup.html): correctly check if specified `-dst` belongs to specified `-storageDataPath`. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4837). +* BUGFIX: [vmctl](https://docs.victoriametrics.com/vmctl.html): don't interrupt the migration process if no metrics were found for a specific tenant. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4796). ## [v1.93.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.93.0)