mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-11 07:25:23 +00:00
Merge branch 'master' into ccr
* master: [CI] Mute Ml rolling upgrade tests Fix license on AcitveDirectorySIDUtil (#30972) [Test] Prefer ArrayList over Vector (#30965) [CI] Mute HttpSecretsIntegrationTests#testWebhookAction test Mute FlushIT tests Add “took” timing info to response for _msearch/template API (#30961)
This commit is contained in:
commit
16402305bb
@ -20,12 +20,14 @@
|
|||||||
package org.elasticsearch.script.mustache;
|
package org.elasticsearch.script.mustache;
|
||||||
|
|
||||||
import org.elasticsearch.ElasticsearchException;
|
import org.elasticsearch.ElasticsearchException;
|
||||||
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.action.ActionResponse;
|
import org.elasticsearch.action.ActionResponse;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.io.stream.Streamable;
|
import org.elasticsearch.common.io.stream.Streamable;
|
||||||
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.common.xcontent.ToXContent;
|
import org.elasticsearch.common.xcontent.ToXContent;
|
||||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
@ -107,12 +109,14 @@ public class MultiSearchTemplateResponse extends ActionResponse implements Itera
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Item[] items;
|
private Item[] items;
|
||||||
|
private long tookInMillis;
|
||||||
|
|
||||||
MultiSearchTemplateResponse() {
|
MultiSearchTemplateResponse() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public MultiSearchTemplateResponse(Item[] items) {
|
public MultiSearchTemplateResponse(Item[] items, long tookInMillis) {
|
||||||
this.items = items;
|
this.items = items;
|
||||||
|
this.tookInMillis = tookInMillis;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -126,6 +130,13 @@ public class MultiSearchTemplateResponse extends ActionResponse implements Itera
|
|||||||
public Item[] getResponses() {
|
public Item[] getResponses() {
|
||||||
return this.items;
|
return this.items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* How long the msearch_template took.
|
||||||
|
*/
|
||||||
|
public TimeValue getTook() {
|
||||||
|
return new TimeValue(tookInMillis);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
@ -134,6 +145,9 @@ public class MultiSearchTemplateResponse extends ActionResponse implements Itera
|
|||||||
for (int i = 0; i < items.length; i++) {
|
for (int i = 0; i < items.length; i++) {
|
||||||
items[i] = Item.readItem(in);
|
items[i] = Item.readItem(in);
|
||||||
}
|
}
|
||||||
|
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
||||||
|
tookInMillis = in.readVLong();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -143,11 +157,15 @@ public class MultiSearchTemplateResponse extends ActionResponse implements Itera
|
|||||||
for (Item item : items) {
|
for (Item item : items) {
|
||||||
item.writeTo(out);
|
item.writeTo(out);
|
||||||
}
|
}
|
||||||
|
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
||||||
|
out.writeVLong(tookInMillis);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {
|
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {
|
||||||
builder.startObject();
|
builder.startObject();
|
||||||
|
builder.field("took", tookInMillis);
|
||||||
builder.startArray(Fields.RESPONSES);
|
builder.startArray(Fields.RESPONSES);
|
||||||
for (Item item : items) {
|
for (Item item : items) {
|
||||||
if (item.isFailure()) {
|
if (item.isFailure()) {
|
||||||
|
@ -94,7 +94,7 @@ public class TransportMultiSearchTemplateAction extends HandledTransportAction<M
|
|||||||
items[originalSlot].getResponse().setResponse(item.getResponse());
|
items[originalSlot].getResponse().setResponse(item.getResponse());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
listener.onResponse(new MultiSearchTemplateResponse(items));
|
listener.onResponse(new MultiSearchTemplateResponse(items, r.getTook().millis()));
|
||||||
}, listener::onFailure));
|
}, listener::onFailure));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
|||||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
|
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
|
||||||
import static org.hamcrest.Matchers.arrayWithSize;
|
import static org.hamcrest.Matchers.arrayWithSize;
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
import static org.hamcrest.Matchers.greaterThan;
|
||||||
import static org.hamcrest.Matchers.instanceOf;
|
import static org.hamcrest.Matchers.instanceOf;
|
||||||
import static org.hamcrest.core.Is.is;
|
import static org.hamcrest.core.Is.is;
|
||||||
|
|
||||||
@ -140,6 +141,7 @@ public class MultiSearchTemplateIT extends ESIntegTestCase {
|
|||||||
|
|
||||||
MultiSearchTemplateResponse response = client().execute(MultiSearchTemplateAction.INSTANCE, multiRequest).get();
|
MultiSearchTemplateResponse response = client().execute(MultiSearchTemplateAction.INSTANCE, multiRequest).get();
|
||||||
assertThat(response.getResponses(), arrayWithSize(5));
|
assertThat(response.getResponses(), arrayWithSize(5));
|
||||||
|
assertThat(response.getTook().millis(), greaterThan(0L));
|
||||||
|
|
||||||
MultiSearchTemplateResponse.Item response1 = response.getResponses()[0];
|
MultiSearchTemplateResponse.Item response1 = response.getResponses()[0];
|
||||||
assertThat(response1.isFailure(), is(false));
|
assertThat(response1.isFailure(), is(false));
|
||||||
|
@ -38,7 +38,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Vector;
|
|
||||||
|
|
||||||
import static org.elasticsearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode;
|
import static org.elasticsearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode;
|
||||||
import static org.elasticsearch.test.XContentTestUtils.insertRandomFields;
|
import static org.elasticsearch.test.XContentTestUtils.insertRandomFields;
|
||||||
@ -146,7 +145,7 @@ public class MeanReciprocalRankTests extends ESTestCase {
|
|||||||
|
|
||||||
public void testCombine() {
|
public void testCombine() {
|
||||||
MeanReciprocalRank reciprocalRank = new MeanReciprocalRank();
|
MeanReciprocalRank reciprocalRank = new MeanReciprocalRank();
|
||||||
Vector<EvalQueryQuality> partialResults = new Vector<>(3);
|
List<EvalQueryQuality> partialResults = new ArrayList<>(3);
|
||||||
partialResults.add(new EvalQueryQuality("id1", 0.5));
|
partialResults.add(new EvalQueryQuality("id1", 0.5));
|
||||||
partialResults.add(new EvalQueryQuality("id2", 1.0));
|
partialResults.add(new EvalQueryQuality("id2", 1.0));
|
||||||
partialResults.add(new EvalQueryQuality("id3", 0.75));
|
partialResults.add(new EvalQueryQuality("id3", 0.75));
|
||||||
|
@ -38,7 +38,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Vector;
|
|
||||||
|
|
||||||
import static org.elasticsearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode;
|
import static org.elasticsearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode;
|
||||||
import static org.elasticsearch.test.XContentTestUtils.insertRandomFields;
|
import static org.elasticsearch.test.XContentTestUtils.insertRandomFields;
|
||||||
@ -163,7 +162,7 @@ public class PrecisionAtKTests extends ESTestCase {
|
|||||||
|
|
||||||
public void testCombine() {
|
public void testCombine() {
|
||||||
PrecisionAtK metric = new PrecisionAtK();
|
PrecisionAtK metric = new PrecisionAtK();
|
||||||
Vector<EvalQueryQuality> partialResults = new Vector<>(3);
|
List<EvalQueryQuality> partialResults = new ArrayList<>(3);
|
||||||
partialResults.add(new EvalQueryQuality("a", 0.1));
|
partialResults.add(new EvalQueryQuality("a", 0.1));
|
||||||
partialResults.add(new EvalQueryQuality("b", 0.2));
|
partialResults.add(new EvalQueryQuality("b", 0.2));
|
||||||
partialResults.add(new EvalQueryQuality("c", 0.6));
|
partialResults.add(new EvalQueryQuality("c", 0.6));
|
||||||
|
@ -254,6 +254,7 @@ public class FlushIT extends ESIntegTestCase {
|
|||||||
result.totalShards(), result.failed(), result.failureReason(), detail);
|
result.totalShards(), result.failed(), result.failureReason(), detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/29392")
|
||||||
@TestLogging("_root:DEBUG,org.elasticsearch.indices.flush:TRACE")
|
@TestLogging("_root:DEBUG,org.elasticsearch.indices.flush:TRACE")
|
||||||
public void testSyncedFlushSkipOutOfSyncReplicas() throws Exception {
|
public void testSyncedFlushSkipOutOfSyncReplicas() throws Exception {
|
||||||
internalCluster().ensureAtLeastNumDataNodes(between(2, 3));
|
internalCluster().ensureAtLeastNumDataNodes(between(2, 3));
|
||||||
@ -296,6 +297,7 @@ public class FlushIT extends ESIntegTestCase {
|
|||||||
assertThat(fullResult.successfulShards(), equalTo(numberOfReplicas + 1));
|
assertThat(fullResult.successfulShards(), equalTo(numberOfReplicas + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/29392")
|
||||||
@TestLogging("_root:DEBUG,org.elasticsearch.indices.flush:TRACE")
|
@TestLogging("_root:DEBUG,org.elasticsearch.indices.flush:TRACE")
|
||||||
public void testDoNotRenewSyncedFlushWhenAllSealed() throws Exception {
|
public void testDoNotRenewSyncedFlushWhenAllSealed() throws Exception {
|
||||||
internalCluster().ensureAtLeastNumDataNodes(between(2, 3));
|
internalCluster().ensureAtLeastNumDataNodes(between(2, 3));
|
||||||
|
@ -1,7 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. Licensed under the Elastic License;
|
* or more contributor license agreements. See the NOTICE file
|
||||||
* you may not use this file except in compliance with the Elastic License.
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -165,6 +165,7 @@ public class HttpSecretsIntegrationTests extends AbstractWatcherIntegrationTestC
|
|||||||
is(ApplicableBasicAuth.headerValue(USERNAME, PASSWORD.toCharArray())));
|
is(ApplicableBasicAuth.headerValue(USERNAME, PASSWORD.toCharArray())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/30094")
|
||||||
public void testWebhookAction() throws Exception {
|
public void testWebhookAction() throws Exception {
|
||||||
WatcherClient watcherClient = watcherClient();
|
WatcherClient watcherClient = watcherClient();
|
||||||
watcherClient.preparePutWatch("_id")
|
watcherClient.preparePutWatch("_id")
|
||||||
|
@ -8,7 +8,9 @@ setup:
|
|||||||
|
|
||||||
---
|
---
|
||||||
"Test open old jobs":
|
"Test open old jobs":
|
||||||
|
- skip:
|
||||||
|
version: "all"
|
||||||
|
reason: "@AwaitsFix: https://github.com/elastic/elasticsearch/issues/30982"
|
||||||
- do:
|
- do:
|
||||||
xpack.ml.open_job:
|
xpack.ml.open_job:
|
||||||
job_id: old-cluster-job
|
job_id: old-cluster-job
|
||||||
@ -75,6 +77,9 @@ setup:
|
|||||||
|
|
||||||
---
|
---
|
||||||
"Test job with no model memory limit has established model memory after reopening":
|
"Test job with no model memory limit has established model memory after reopening":
|
||||||
|
- skip:
|
||||||
|
version: "all"
|
||||||
|
reason: "@AwaitsFix: https://github.com/elastic/elasticsearch/issues/30982"
|
||||||
- do:
|
- do:
|
||||||
xpack.ml.open_job:
|
xpack.ml.open_job:
|
||||||
job_id: no-model-memory-limit-job
|
job_id: no-model-memory-limit-job
|
||||||
|
Loading…
x
Reference in New Issue
Block a user