Skip to content

Commit

Permalink
Update SearchPipelineInfo backcompat check (#7672)
Browse files Browse the repository at this point in the history
Now that we've backported the SearchPipelineInfo serialization change to
2.x ahead of the 2.8 release, we need to update the compatibility check
from <=2.8 to <2.8, as mentioned in the previous TODO.

This change should be merged (immediately) after
#7669.

Signed-off-by: Michael Froh <froh@amazon.com>
  • Loading branch information
msfroh authored May 23, 2023
1 parent 114556c commit b4b3724
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ public SearchPipelineInfo(Map<String, List<ProcessorInfo>> processors) {
* Read from a stream.
*/
public SearchPipelineInfo(StreamInput in) throws IOException {
// TODO: When we backport this to 2.8, we must change this condition to out.getVersion().before(V_2_8_0)
if (in.getVersion().onOrBefore(Version.V_2_8_0)) {
if (in.getVersion().before(Version.V_2_8_0)) {
// Prior to version 2.8, we had a flat list of processors. For best compatibility, assume they're valid
// request and response processor, since we couldn't tell the difference back then.
final int size = in.readVInt();
Expand Down Expand Up @@ -84,8 +83,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws

@Override
public void writeTo(StreamOutput out) throws IOException {
// TODO: When we backport this to 2.8, we must change this condition to out.getVersion().before(V_2_8_0)
if (out.getVersion().onOrBefore(Version.V_2_8_0)) {
if (out.getVersion().before(Version.V_2_8_0)) {
// Prior to version 2.8, we grouped all processors into a single list.
Set<ProcessorInfo> processorInfos = new TreeSet<>();
processorInfos.addAll(processors.getOrDefault(Pipeline.REQUEST_PROCESSORS_KEY, Collections.emptySet()));
Expand Down

0 comments on commit b4b3724

Please sign in to comment.