Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/vmselectapi: do not send empty label names for labelNames request #4936

Merged
merged 4 commits into from Sep 1, 2023

Conversation

f41gh7
Copy link
Contributor

@f41gh7 f41gh7 commented Sep 1, 2023

it breaks cluster communication, since vmselect incorrectly reads request buffer, leaving unread data on it #4932

it breaks cluster communication, since vmselect incorrectly reads request buffer, leaving unread data on it
#4932
Copy link
Contributor

@zekker6 zekker6 left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.02% ⚠️

Comparison is base (b9b2fbc) 59.32% compared to head (c576244) 59.31%.
Report is 4 commits behind head on cluster.

❗ Current head c576244 differs from pull request most recent head 8f0cc7a. Consider uploading reports for the commit 8f0cc7a to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           cluster    #4936      +/-   ##
===========================================
- Coverage    59.32%   59.31%   -0.02%     
===========================================
  Files          394      394              
  Lines        74759    74759              
===========================================
- Hits         44353    44344       -9     
- Misses       27976    27978       +2     
- Partials      2430     2437       +7     

see 8 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -919,6 +923,9 @@ func (s *Server) processTenants(ctx *vmselectRequestCtx) error {

// Send tenants to vmselect
for _, tenant := range tenants {
if len(tenant) == 0 {
return fmt.Errorf("BUG: unexpected empty tenant name")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it is better to just skip an empty tenant and log this issue instead of returning the error, since this error makes the tenant API unusable.

@valyala valyala merged commit fac272b into cluster Sep 1, 2023
3 checks passed
@valyala valyala deleted the gh-4932 branch September 1, 2023 21:24
@valyala
Copy link
Collaborator

valyala commented Sep 1, 2023

@f41gh7 , thanks for the bugfix!

valyala added a commit that referenced this pull request Sep 1, 2023
…#4936)

* lib/vmselectapi: do not send empty label names for labelNames request
it breaks cluster communication, since vmselect incorrectly reads request buffer, leaving unread data on it
#4932

* typo fix

* wip

---------

Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
valyala added a commit that referenced this pull request Sep 1, 2023
…#4936)

* lib/vmselectapi: do not send empty label names for labelNames request
it breaks cluster communication, since vmselect incorrectly reads request buffer, leaving unread data on it
#4932

* typo fix

* wip

---------

Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
valyala added a commit that referenced this pull request Sep 1, 2023
…#4936)

* lib/vmselectapi: do not send empty label names for labelNames request
it breaks cluster communication, since vmselect incorrectly reads request buffer, leaving unread data on it
#4932

* typo fix

* wip

---------

Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
valyala added a commit that referenced this pull request Sep 1, 2023
…#4936)

* lib/vmselectapi: do not send empty label names for labelNames request
it breaks cluster communication, since vmselect incorrectly reads request buffer, leaving unread data on it
#4932

* typo fix

* wip

---------

Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
valyala added a commit that referenced this pull request Sep 1, 2023
…#4936)

* lib/vmselectapi: do not send empty label names for labelNames request
it breaks cluster communication, since vmselect incorrectly reads request buffer, leaving unread data on it
#4932

* typo fix

* wip

---------

Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
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.

None yet

3 participants