Skip to content

Commit b0746b2

Browse files
authored
Merge branch 'main' into test-fix/replace-default-backing-index-name-ilm
2 parents 178a706 + e51b501 commit b0746b2

File tree

18 files changed

+211
-284
lines changed

18 files changed

+211
-284
lines changed

docs/changelog/122885.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 122885
2+
summary: Run `TransportExplainLifecycleAction` on local node
3+
area: ILM+SLM
4+
type: enhancement
5+
issues: []
54.4 KB
Loading
209 KB
Loading
44.7 KB
Loading
162 KB
Loading
71.9 KB
Loading
249 KB
Loading

docs/reference/query-languages/query-dsl-function-score-query.md

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -510,13 +510,11 @@ Next, we show how the computed score looks like for each of the three possible d
510510

511511
When choosing `gauss` as the decay function in the above example, the contour and surface plot of the multiplier looks like this:
512512

513-
% :::{image} https://f.cloud.github.com/assets/4320215/768157/cd0e18a6-e898-11e2-9b3c-f0145078bd6f.png
514-
% :alt: cd0e18a6 e898 11e2 9b3c f0145078bd6f
515-
% :::
513+
:::{image} ../../images/normal-decay-keyword-gauss-1.png
514+
:::
516515

517-
% :::{image} https://f.cloud.github.com/assets/4320215/768160/ec43c928-e898-11e2-8e0d-f3c4519dbd89.png
518-
% :alt: ec43c928 e898 11e2 8e0d f3c4519dbd89
519-
% :::
516+
:::{image} ../../images/normal-decay-keyword-gauss-2.png
517+
:::
520518

521519
Suppose your original search results matches three hotels :
522520

@@ -531,28 +529,21 @@ Suppose your original search results matches three hotels :
531529

532530
When choosing `exp` as the decay function in the above example, the contour and surface plot of the multiplier looks like this:
533531

534-
% :::{image} https://f.cloud.github.com/assets/4320215/768161/082975c0-e899-11e2-86f7-174c3a729d64.png
535-
% :alt: 082975c0 e899 11e2 86f7 174c3a729d64
536-
% :::
537-
538-
% :::{image} https://f.cloud.github.com/assets/4320215/768162/0b606884-e899-11e2-907b-aefc77eefef6.png
539-
% :alt: 0b606884 e899 11e2 907b aefc77eefef6
540-
% :::
532+
:::{image} ../../images/exponential-decay-keyword-exp-1.png
533+
:::
541534

535+
:::{image} ../../images/exponential-decay-keyword-exp-2.png
536+
:::
542537

543538
### Linear decay, keyword `linear` [linear-decay]
544539

545540
When choosing `linear` as the decay function in the above example, the contour and surface plot of the multiplier looks like this:
546541

547-
% :::{image} https://f.cloud.github.com/assets/4320215/768164/1775b0ca-e899-11e2-9f4a-776b406305c6.png
548-
% :alt: 1775b0ca e899 11e2 9f4a 776b406305c6
549-
% :::
550-
551-
% :::{image} https://f.cloud.github.com/assets/4320215/768165/19d8b1aa-e899-11e2-91bc-6b0553e8d722.png
552-
% :alt: 19d8b1aa e899 11e2 91bc 6b0553e8d722
553-
% :::
554-
542+
:::{image} ../../images/linear-decay-keyword-linear-1.png
543+
:::
555544

545+
:::{image} ../../images/linear-decay-keyword-linear-2.png
546+
:::
556547

557548
## Supported fields for decay functions [_supported_fields_for_decay_functions]
558549

server/src/main/java/org/elasticsearch/action/search/SearchResponse.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.elasticsearch.common.Strings;
1616
import org.elasticsearch.common.bytes.BytesReference;
1717
import org.elasticsearch.common.collect.Iterators;
18+
import org.elasticsearch.common.io.stream.DelayableWriteable;
1819
import org.elasticsearch.common.io.stream.StreamInput;
1920
import org.elasticsearch.common.io.stream.StreamOutput;
2021
import org.elasticsearch.common.io.stream.Writeable;
@@ -92,7 +93,15 @@ public class SearchResponse extends ActionResponse implements ChunkedToXContentO
9293
public SearchResponse(StreamInput in) throws IOException {
9394
super(in);
9495
this.hits = SearchHits.readFrom(in, true);
95-
this.aggregations = in.readBoolean() ? InternalAggregations.readFrom(in) : null;
96+
if (in.readBoolean()) {
97+
// deserialize the aggregations trying to deduplicate the object created
98+
// TODO: use DelayableWriteable instead.
99+
this.aggregations = InternalAggregations.readFrom(
100+
DelayableWriteable.wrapWithDeduplicatorStreamInput(in, in.getTransportVersion(), in.namedWriteableRegistry())
101+
);
102+
} else {
103+
this.aggregations = null;
104+
}
96105
this.suggest = in.readBoolean() ? new Suggest(in) : null;
97106
this.timedOut = in.readBoolean();
98107
this.terminatedEarly = in.readOptionalBoolean();

server/src/main/java/org/elasticsearch/cluster/ClusterState.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,28 @@ public boolean hasMixedSystemIndexVersions() {
350350
.anyMatch(e -> e.systemIndexMappingsVersion().equals(minVersions.systemIndexMappingsVersion()) == false);
351351
}
352352

353+
/**
354+
* @return the minimum {@link TransportVersion} that will be used for all future intra-cluster node-to-node communications. This value
355+
* only ever increases, so if {@code v.onOrAfter(cs.getMinTransportVersion())} is true once then it will remain true in the
356+
* future.
357+
* <p>
358+
* There are some subtle exceptions:
359+
* <ul>
360+
* <li>The "only ever increases" property is handled by the master node using the in-memory (ephemeral) part of the
361+
* {@link ClusterState} only, so in theory a full restart of a mixed-version cluster may lose that state and allow some nodes to see
362+
* this value decrease. For this to happen in practice requires some fairly unlucky timing during the initial master election. We
363+
* tell users not to do this: if something breaks during a rolling upgrade then they should upgrade all remaining nodes to continue.
364+
* But we do not enforce it.
365+
* <li>The "used for all node-to-node communications" is false in a disordered upgrade (an upgrade to a semantically-newer but
366+
* chronologically-older version) because for each connection between such nodes we will use {@link
367+
* TransportVersion#bestKnownVersion} to pick a transport version which is known by both endpoints. We tell users not to do
368+
* disordered upgrades too, but do not enforce it.
369+
* </ul>
370+
* <p>
371+
* Note also that node-to-node communications which are not <i>intra-cluster</i> (i.e. they are not between nodes in the same cluster)
372+
* may sometimes use an earlier {@link TransportVersion} than this value. This includes remote-cluster communication, and communication
373+
* with nodes that are just starting up or otherwise are attempting to join this cluster.
374+
*/
353375
public TransportVersion getMinTransportVersion() {
354376
return this.minVersions.transportVersion();
355377
}

0 commit comments

Comments
 (0)