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

Fix routing with leading or trailing whitespace #27712

Conversation

@jasontedor
Copy link
Member

commented Dec 7, 2017

The problem here is that splitting was using a method that intentionally trims whitespace (the method is really meant to be used for splitting parameters where whitespace should be trimmed like list settings). However, for routing values whitespace should not be trimmed because we allow routing with leading and trailing spaces. This commit switches the parsing of these routing values to a method that does not trim whitespace.

Closes #27708

The problem here is that splitting was using a method that intentionally
trims whitespace (the method is really meant to be used for splitting
parameters where whitespace should be trimmed like list
settings). However, for routing values whitespace should not be trimmed
because we allow routing with leading and trailing spaces. This commit
switches the parsing of these routing values to a method that does not
trim whitespace.
jasontedor added 2 commits Dec 7, 2017
…space

* master:
  Add test for writer operation buffer accounting (#27707)
  [TEST] Wait for merging to complete before testing breaker
@dakrone
dakrone approved these changes Dec 7, 2017
Copy link
Member

left a comment

LGTM, we should fix the Strings.splitStringByCommaToSet functionality too though (I see Nhat already opened an issue for this)

@jasontedor

This comment has been minimized.

Copy link
Member Author

commented Dec 8, 2017

What is wrong with it? Is it not doing what we want it doing be doing? We have unit tests exactly for that behavior. We seem to be using it in places where we have decided that we want whitespace stripped (personally, I am opposed to this, but I lost that argument).

Relates #22591

@jasontedor

This comment has been minimized.

Copy link
Member Author

commented Dec 8, 2017

test this please

@jasontedor

This comment has been minimized.

Copy link
Member Author

commented Dec 8, 2017

@dakrone Okay, I opened #27715. I renamed the method, I hope this removes the confusion. The behavior can not change, it is doing what we want it to do.

@jasontedor jasontedor merged commit ec5e540 into elastic:master Dec 8, 2017
2 checks passed
2 checks passed
CLA Commit author is a member of Elasticsearch
Details
elasticsearch-ci Build finished.
Details
jasontedor added a commit that referenced this pull request Dec 8, 2017
The problem here is that splitting was using a method that intentionally
trims whitespace (the method is really meant to be used for splitting
parameters where whitespace should be trimmed like list
settings). However, for routing values whitespace should not be trimmed
because we allow routing with leading and trailing spaces. This commit
switches the parsing of these routing values to a method that does not
trim whitespace.

Relates #27712
jasontedor added a commit that referenced this pull request Dec 8, 2017
The problem here is that splitting was using a method that intentionally
trims whitespace (the method is really meant to be used for splitting
parameters where whitespace should be trimmed like list
settings). However, for routing values whitespace should not be trimmed
because we allow routing with leading and trailing spaces. This commit
switches the parsing of these routing values to a method that does not
trim whitespace.

Relates #27712
jasontedor added a commit that referenced this pull request Dec 8, 2017
The problem here is that splitting was using a method that intentionally
trims whitespace (the method is really meant to be used for splitting
parameters where whitespace should be trimmed like list
settings). However, for routing values whitespace should not be trimmed
because we allow routing with leading and trailing spaces. This commit
switches the parsing of these routing values to a method that does not
trim whitespace.

Relates #27712
jasontedor added a commit that referenced this pull request Dec 8, 2017
The problem here is that splitting was using a method that intentionally
trims whitespace (the method is really meant to be used for splitting
parameters where whitespace should be trimmed like list
settings). However, for routing values whitespace should not be trimmed
because we allow routing with leading and trailing spaces. This commit
switches the parsing of these routing values to a method that does not
trim whitespace.

Relates #27712
@jasontedor jasontedor deleted the jasontedor:fix-routing-with-leading-or-trailing-whitespace branch Dec 8, 2017
@jasontedor jasontedor added v6.1.1 and removed v6.1.0 labels Dec 8, 2017
@colings86 colings86 added v7.0.0-beta1 and removed v7.0.0 labels Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.