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

Allowing {index}/_xpack/rollup/data to accept comma delimited list #34115

Merged
merged 3 commits into from
Oct 2, 2018

Conversation

benwtrent
Copy link
Member

{index}/_xpack/rollup/data is supposed to be able to return given a comma delimited list of indices, there was a slight oversight on the REST facing side that caused index lookups to be the literal string and not an expanded list from the parameter.

I apologize if the labels are not correct, this is my first bug PR referencing a released version.

@benwtrent benwtrent added >bug v7.0.0 :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data v6.5.0 v6.4.2 labels Sep 27, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@benwtrent
Copy link
Member Author

Jenkins, retest this please

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

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

Good catch @benwtrent ! I left some comments

---
"Verify job caps by rollup index comma delimited list":

- do:
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll need to add a skip section to not run this test on version that don't have the fix:

  - skip:
      version: " - 6.99.99"
      reason: "comma delimited index support was fixed in 7.0"

After the backport to 6x we'll change the skip version to 6.4.99.

@@ -27,7 +28,8 @@ public RestGetRollupIndexCapsAction(Settings settings, RestController controller
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) {
String index = restRequest.param(INDEX.getPreferredName());
IndicesOptions options = IndicesOptions.fromRequest(restRequest, IndicesOptions.STRICT_EXPAND_OPEN_FORBID_CLOSED);
GetRollupIndexCapsAction.Request request = new GetRollupIndexCapsAction.Request(new String[]{index}, options);
GetRollupIndexCapsAction.Request request =
new GetRollupIndexCapsAction.Request(Strings.commaDelimitedListToStringArray(index), options);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you use Strings.splitStringByCommaToArray, it should be equivalent but that's the function used by the other action when they parse the index param.

@benwtrent benwtrent removed the v6.4.2 label Sep 28, 2018
Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @benwtrent

@benwtrent benwtrent merged commit 10201e0 into elastic:master Oct 2, 2018
@benwtrent benwtrent deleted the bug/fix-get-rollup-index-caps branch October 2, 2018 13:21
benwtrent added a commit that referenced this pull request Oct 2, 2018
…34115)

* Allowing `{index}/_xpack/rollup/data` to accept comma delimited list

* Address PR comments
kcm pushed a commit that referenced this pull request Oct 30, 2018
…34115)

* Allowing `{index}/_xpack/rollup/data` to accept comma delimited list

* Address PR comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data v6.5.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants