Skip to content

vmdistributed: change default write requests load balancing policy from first_available to least_loaded#2099

Merged
vrutkovs merged 1 commit intomasterfrom
vmdistributed-write-lb-policy
Apr 24, 2026
Merged

vmdistributed: change default write requests load balancing policy from first_available to least_loaded#2099
vrutkovs merged 1 commit intomasterfrom
vmdistributed-write-lb-policy

Conversation

@AndrewChubatiuk
Copy link
Copy Markdown
Contributor

@AndrewChubatiuk AndrewChubatiuk commented Apr 24, 2026

Summary by cubic

Switches the default load balancing policy for write requests in vmdistributed from first_available to least_loaded to spread write load evenly across VMAgents. Read requests remain on first_available.

  • Bug Fixes
    • Update vmauth "write" target to use least_loaded; retry codes unchanged.
    • Adjust tests to expect the new default and add explicit policies for write/read.
    • Add changelog entry.

Written for commit 6a9d422. Summary will update on new commits.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/CHANGELOG.md">

<violation number="1" location="docs/CHANGELOG.md:19">
P2: Custom agent: **Changelog Review Agent**

New changelog entry is missing required issue/PR reference links mandated by the changelog format.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread docs/CHANGELOG.md
* FEATURE: [vmauth](https://docs.victoriametrics.com/operator/resources/vmauth): previously VMAuth could read configuration only from predefined locations; now VMAuth supports arbitrary filesystem access configuration, allowing users to reference required files directly and reducing configuration workarounds. See [#899](https://github.com/VictoriaMetrics/operator/issues/899).

* BUGFIX: [converter](https://docs.victoriametrics.com/operator/integrations/prometheus/#objects-conversion): disable all prometheus controllers if CRD group was not found. See [#2838](https://github.com/VictoriaMetrics/helm-charts/issues/2838).
* BUGFIX: [vmdistributed](https://docs.victoriametrics.com/operator/resources/vmdistributed/): change default load balancing policy for write requests from `first_available` to `least_loaded`. This should allow to evenly distribute write load across all VMAgents.
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Custom agent: Changelog Review Agent

New changelog entry is missing required issue/PR reference links mandated by the changelog format.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/CHANGELOG.md, line 19:

<comment>New changelog entry is missing required issue/PR reference links mandated by the changelog format.</comment>

<file context>
@@ -16,6 +16,7 @@ aliases:
 * FEATURE: [vmauth](https://docs.victoriametrics.com/operator/resources/vmauth): previously VMAuth could read configuration only from predefined locations; now VMAuth supports arbitrary filesystem access configuration, allowing users to reference required files directly and reducing configuration workarounds. See [#899](https://github.com/VictoriaMetrics/operator/issues/899).
 
 * BUGFIX: [converter](https://docs.victoriametrics.com/operator/integrations/prometheus/#objects-conversion): disable all prometheus controllers if CRD group was not found. See [#2838](https://github.com/VictoriaMetrics/helm-charts/issues/2838).
+* BUGFIX: [vmdistributed](https://docs.victoriametrics.com/operator/resources/vmdistributed/): change default load balancing policy for write requests from `first_available` to `least_loaded`. This should allow to evenly distribute write load across all VMAgents.
 
 ## [v0.69.0](https://github.com/VictoriaMetrics/operator/releases/tag/v0.69.0)
</file context>
Fix with Cubic

Name: "write",
URLMapCommon: vmv1beta1.URLMapCommon{
LoadBalancingPolicy: ptr.To("first_available"),
LoadBalancingPolicy: ptr.To("least_loaded"),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it needs to be complimented with removing exclude IDs from vmAgentTargetRef, so that we'd be writing in all zones (queues would grow when its being updated)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vmagent is excluded as well in case if it can be restarted due to upgrade

@vrutkovs vrutkovs merged commit 9ccea4a into master Apr 24, 2026
7 checks passed
@vrutkovs vrutkovs deleted the vmdistributed-write-lb-policy branch April 24, 2026 10:36
@vrutkovs
Copy link
Copy Markdown
Collaborator

Thanks, could you backport it to 0.68.x too please?

AndrewChubatiuk added a commit that referenced this pull request Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants