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

Retain originalIndex info when rewriting FieldCapabilities requests #27761

Merged
merged 2 commits into from Dec 19, 2017

Conversation

albertzaharovits
Copy link
Contributor

A FieldCapabilities request can cover multiple indices (or aliases pointing to multiple indices).
The original request is rewritten for each concrete index but these new requests miss the original requested indices.

This PR mimics GetFieldMapping behavior, see GetFieldMappingsIndexRequest.

@albertzaharovits albertzaharovits added :Internal :Search/Search Search-related issues that do not fall into other categories >bug v6.2.0 v7.0.0 labels Dec 11, 2017
@albertzaharovits albertzaharovits self-assigned this Dec 11, 2017
}

@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeStringArray(fields);
OriginalIndices.writeOriginalIndices(originalIndices, out);
Copy link
Member

Choose a reason for hiding this comment

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

this breaks backwards compatibility, you will need if based on version in both readFrom and writeTo

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

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

LGTM besides the bw comp comment I left. It would also be nice to have some test that fails without the fix. We should have some tests around original indices for other classes where they are used.

@albertzaharovits
Copy link
Contributor Author

Thank you @javanna for the instant review!

I have added a test of original indices for FieldCapabilities. I think all other places are covered.

I am not sure about OriginalIndices.NONE when deserializing from an incompatible version :/

Can you please take another look?

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

@albertzaharovits albertzaharovits merged commit 01a47ba into elastic:master Dec 19, 2017
albertzaharovits added a commit that referenced this pull request Dec 19, 2017
…27761)

A FieldCapabilities request can cover multiple indices (or aliases pointing to multiple indices).
When rewriting the request for each index, store the original requested indices.
@albertzaharovits albertzaharovits deleted the fieldCapabilities branch December 19, 2017 12:40
@gf53520
Copy link

gf53520 commented Oct 26, 2021

@albertzaharovits @javanna @jimczi we are using sql contains 1500+ indices, and found client nodes have must serialization cost for executing sql schema check and shard search. I think it is not expected, why we need keep the original indices in above shard level request (starting from #7319), instead of just like the shard request which don't contains original indices?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories v6.2.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants