Skip to content

Commit b23d0de

Browse files
authored
Merge branch 'main' into model_registry_compatible_version
2 parents d780a2a + 177da5f commit b23d0de

File tree

22 files changed

+96
-27
lines changed

22 files changed

+96
-27
lines changed

docs/changelog/124669.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pr: 124669
2+
summary: Release semantic_text as a GA feature
3+
area: Mapping
4+
type: feature
5+
issues: []
6+
highlight:
7+
title: Release semantic_text as a GA feature
8+
body: semantic_text is now an official GA (generally available) feature!
9+
This field type allows you to easily set up and perform semantic search with minimal ramp up time.
10+
notable: true

docs/changelog/125244.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 125244
2+
summary: Disable logging in `ClusterFormationFailureHelper` on shutdown
3+
area: Cluster Coordination
4+
type: bug
5+
issues:
6+
- 105559

docs/changelog/125259.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 125259
2+
summary: Leverage scorer supplier in `QueryFeatureExtractor`
3+
area: Ranking
4+
type: enhancement
5+
issues: []

docs/reference/elasticsearch/mapping-reference/semantic-text.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ mapped_pages:
66

77
# Semantic text field type [semantic-text]
88

9-
10-
::::{warning}
11-
This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.
12-
::::
13-
14-
159
The `semantic_text` field type automatically generates embeddings for text content using an inference endpoint. Long passages are [automatically chunked](#auto-text-chunking) to smaller sections to enable the processing of larger corpuses of text.
1610

1711
The `semantic_text` field type specifies an inference endpoint identifier that will be used to generate embeddings. You can create the inference endpoint by using the [Create {{infer}} API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put). This field type and the [`semantic` query](/reference/query-languages/query-dsl/query-dsl-semantic-query.md) type make it simpler to perform semantic search on your data. The `semantic_text` field type may also be queried with [match](/reference/query-languages/query-dsl/query-dsl-match-query.md), [sparse_vector](/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md) or [knn](/reference/query-languages/query-dsl/query-dsl-knn-query.md) queries.

docs/reference/query-languages/query-dsl/query-dsl-semantic-query.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ mapped_pages:
66

77
# Semantic query [query-dsl-semantic-query]
88

9-
10-
::::{warning}
11-
This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.
12-
::::
13-
14-
159
The `semantic` query type enables you to perform [semantic search](docs-content://solutions/search/semantic-search.md) on data stored in a [`semantic_text`](/reference/elasticsearch/mapping-reference/semantic-text.md) field.
1610

1711

server/src/main/java/org/elasticsearch/cluster/coordination/ClusterFormationFailureHelper.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public class ClusterFormationFailureHelper {
6868
private final Runnable logLastFailedJoinAttempt;
6969
@Nullable // if no warning is scheduled
7070
private volatile WarningScheduler warningScheduler;
71+
private volatile boolean loggingEnabled;
7172

7273
/**
7374
* Works with the {@link JoinHelper} to log the latest node-join attempt failure and cluster state debug information. Must call
@@ -90,6 +91,11 @@ public ClusterFormationFailureHelper(
9091
this.clusterCoordinationExecutor = threadPool.executor(Names.CLUSTER_COORDINATION);
9192
this.clusterFormationWarningTimeout = DISCOVERY_CLUSTER_FORMATION_WARNING_TIMEOUT_SETTING.get(settings);
9293
this.logLastFailedJoinAttempt = logLastFailedJoinAttempt;
94+
this.loggingEnabled = true;
95+
}
96+
97+
public void setLoggingEnabled(boolean enabled) {
98+
this.loggingEnabled = enabled;
9399
}
94100

95101
public boolean isRunning() {
@@ -98,7 +104,7 @@ public boolean isRunning() {
98104

99105
/**
100106
* Schedules a warning debug message to be logged in 'clusterFormationWarningTimeout' time, and periodically thereafter, until
101-
* {@link ClusterFormationState#stop()} has been called.
107+
* {@link ClusterFormationFailureHelper#stop()} has been called.
102108
*/
103109
public void start() {
104110
assert warningScheduler == null;
@@ -125,7 +131,7 @@ public void onFailure(Exception e) {
125131

126132
@Override
127133
protected void doRun() {
128-
if (isActive()) {
134+
if (isActive() && loggingEnabled) {
129135
logLastFailedJoinAttempt.run();
130136
logger.warn(
131137
"{}; for troubleshooting guidance, see {}",

server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,7 @@ protected void doStart() {
11041104
applierState = initialState;
11051105
clusterApplier.setInitialState(initialState);
11061106
}
1107+
clusterFormationFailureHelper.setLoggingEnabled(true);
11071108
}
11081109

11091110
public DiscoveryStats stats() {
@@ -1126,6 +1127,7 @@ public void startInitialJoin() {
11261127
protected void doStop() {
11271128
configuredHostsResolver.stop();
11281129
joinValidationService.stop();
1130+
clusterFormationFailureHelper.setLoggingEnabled(false);
11291131
}
11301132

11311133
@Override

server/src/main/java/org/elasticsearch/cluster/metadata/ProjectId.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static ProjectId fromId(String id) {
5454
}
5555
}
5656

57-
static boolean isValidFormatId(String id) {
57+
public static boolean isValidFormatId(String id) {
5858
if (id.length() > MAX_LENGTH) {
5959
return false;
6060
}

server/src/test/java/org/elasticsearch/cluster/coordination/ClusterFormationFailureHelperTests.java

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,45 @@ public void testScheduling() {
171171

172172
assertThat(warningCount.get(), is(5L));
173173
assertThat(logLastFailedJoinAttemptWarningCount.get(), is(5L));
174+
175+
// Temporarily disable logging and verify we don't get incremented logging counts.
176+
clusterFormationFailureHelper.setLoggingEnabled(false);
177+
warningCount.set(0);
178+
logLastFailedJoinAttemptWarningCount.set(0);
179+
clusterFormationFailureHelper.start();
180+
clusterFormationFailureHelper.stop();
181+
clusterFormationFailureHelper.start();
182+
final long thirdStartTimeMillis = deterministicTaskQueue.getCurrentTimeMillis();
183+
184+
while (deterministicTaskQueue.getCurrentTimeMillis() - thirdStartTimeMillis < 5 * expectedDelayMillis) {
185+
assertTrue(clusterFormationFailureHelper.isRunning());
186+
if (deterministicTaskQueue.hasRunnableTasks()) {
187+
deterministicTaskQueue.runRandomTask();
188+
} else {
189+
deterministicTaskQueue.advanceTime();
190+
}
191+
}
192+
193+
assertThat(warningCount.get(), is(0L));
194+
assertThat(logLastFailedJoinAttemptWarningCount.get(), is(0L));
195+
196+
// Re-enable logging and verify the logging counts again.
197+
clusterFormationFailureHelper.stop();
198+
clusterFormationFailureHelper.start();
199+
clusterFormationFailureHelper.setLoggingEnabled(true);
200+
final long fourthStartTimeMillis = deterministicTaskQueue.getCurrentTimeMillis();
201+
202+
while (warningCount.get() < 5) {
203+
assertTrue(clusterFormationFailureHelper.isRunning());
204+
if (deterministicTaskQueue.hasRunnableTasks()) {
205+
deterministicTaskQueue.runRandomTask();
206+
} else {
207+
deterministicTaskQueue.advanceTime();
208+
}
209+
}
210+
assertThat(deterministicTaskQueue.getCurrentTimeMillis() - fourthStartTimeMillis, equalTo(5 * expectedDelayMillis));
211+
assertThat(warningCount.get(), is(5L));
212+
assertThat(logLastFailedJoinAttemptWarningCount.get(), is(5L));
174213
}
175214

176215
public void testDescriptionOnMasterIneligibleNodes() {

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferenceNamedWriteablesProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
import org.elasticsearch.xpack.inference.services.cohere.rerank.CohereRerankServiceSettings;
6060
import org.elasticsearch.xpack.inference.services.cohere.rerank.CohereRerankTaskSettings;
6161
import org.elasticsearch.xpack.inference.services.deepseek.DeepSeekChatCompletionModel;
62-
import org.elasticsearch.xpack.inference.services.elastic.ElasticInferenceServiceSparseEmbeddingsServiceSettings;
6362
import org.elasticsearch.xpack.inference.services.elastic.completion.ElasticInferenceServiceCompletionServiceSettings;
63+
import org.elasticsearch.xpack.inference.services.elastic.sparseembeddings.ElasticInferenceServiceSparseEmbeddingsServiceSettings;
6464
import org.elasticsearch.xpack.inference.services.elasticsearch.CustomElandInternalServiceSettings;
6565
import org.elasticsearch.xpack.inference.services.elasticsearch.CustomElandInternalTextEmbeddingServiceSettings;
6666
import org.elasticsearch.xpack.inference.services.elasticsearch.ElasticRerankerServiceSettings;

0 commit comments

Comments
 (0)