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

Merged
merged 4 commits into from Dec 8, 2017

Conversation

Projects
None yet
2 participants
@jasontedor
Member

jasontedor 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

Fix routing with leading or trailing whitespace
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 some commits Dec 7, 2017

Merge branch 'master' into fix-routing-with-leading-or-trailing-white…
…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

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.

Show comment
Hide comment
@jasontedor

jasontedor Dec 8, 2017

Member

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

Member

jasontedor 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.

Show comment
Hide comment
@jasontedor

jasontedor Dec 8, 2017

Member

test this please

Member

jasontedor commented Dec 8, 2017

test this please

@jasontedor

This comment has been minimized.

Show comment
Hide comment
@jasontedor

jasontedor Dec 8, 2017

Member

@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.

Member

jasontedor 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

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

Fix routing with leading or trailing whitespace
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

Fix routing with leading or trailing whitespace
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

Fix routing with leading or trailing whitespace
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

Fix routing with leading or trailing whitespace
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment