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
Retain originalIndex info when rewriting FieldCapabilities requests #27761
Conversation
} | ||
|
||
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
super.writeTo(out); | ||
out.writeStringArray(fields); | ||
OriginalIndices.writeOriginalIndices(originalIndices, out); |
There was a problem hiding this comment.
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
There was a problem hiding this 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.
Thank you @javanna for the instant review! I have added a test of original indices for I am not sure about Can you please take another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…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 @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? |
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.