From 6c3dd16a1686e5326549035e13a7a7f79214b485 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 16 Oct 2023 20:52:52 +0200 Subject: [PATCH] app/vmagent/remotewrite: move sas var initialization closer to the place where it is used This makes the code sligthtly easier to understand. This is a follow-up for 1d3d989be562a22ad18d9921fe15f00b6ef73d41 Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5170 --- app/vmagent/remotewrite/remotewrite.go | 3 +-- docs/CHANGELOG.md | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/vmagent/remotewrite/remotewrite.go b/app/vmagent/remotewrite/remotewrite.go index ccd7a77be..fe82e781a 100644 --- a/app/vmagent/remotewrite/remotewrite.go +++ b/app/vmagent/remotewrite/remotewrite.go @@ -748,8 +748,6 @@ func (rwctx *remoteWriteCtx) reinitStreamAggr() { return } - sas := rwctx.sas.Load() - logger.Infof("reloading stream aggregation configs pointed by -remoteWrite.streamAggr.config=%q", sasFile) metrics.GetOrCreateCounter(fmt.Sprintf(`vmagent_streamaggr_config_reloads_total{path=%q}`, sasFile)).Inc() dedupInterval := streamAggrDedupInterval.GetOptionalArg(rwctx.idx) @@ -760,6 +758,7 @@ func (rwctx *remoteWriteCtx) reinitStreamAggr() { logger.Errorf("cannot reload stream aggregation config from -remoteWrite.streamAggr.config=%q; continue using the previously loaded config; error: %s", sasFile, err) return } + sas := rwctx.sas.Load() if !sasNew.Equal(sas) { sasOld := rwctx.sas.Swap(sasNew) sasOld.MustStop() diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 44ffd5abe..1b1729bff 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -53,7 +53,7 @@ The sandbox cluster installation is running under the constant load generated by * BUGFIX: dashboards: fix vminsert/vmstorage/vmselect metrics filtering when dashboard is used to display data from many sub-clusters with unique job names. Before, only one specific job could have been accounted for component-specific panels, instead of all available jobs for the component. * BUGFIX: [VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html): bump hard-coded limit for search query size at `vmstorage` from 1MB to 5MB. The change should be more suitable for real-world scenarios and protect vmstorage from excessive memory usage. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5154) for details * BUGFIX: [vmbackup](https://docs.victoriametrics.com/vmbackup.html): fix error when creating an incremental backup with the `-origin` command-line flag. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5144) for details. -* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): fix vmagent ignoring configuration reload for streaming aggregation if it was started with empty streaming aggregation config. Thanks to @aluode99 for the [pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/5178). +* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): fix vmagent ignoring configuration reload for streaming aggregation if it was started with empty streaming aggregation config. Thanks to @aluode99 for the [pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/5178). ## [v1.94.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.94.0)