Skip to content

Commit ba4d0a5

Browse files
committed
Merge branch 'master' into mandatory-meta-plugins
* master: Enable selecting adaptive selection stats Remove leftover mention of file-based scripts Fix threading issue on listener notification (elastic#28730) Revisit deletion policy after release the last snapshot (elastic#28627) Remove unused method Track deletes only in the tombstone map instead of maintaining as copy (elastic#27868) [Docs] Correct typo in README.textile (elastic#28716) Fix AdaptiveSelectionStats serialization bug (elastic#28718) TEST: Fix InternalEngine#testAcquireIndexCommit Add note on temporary directory for Windows service Added coming annotation and breaking changes link to release notes script Remove leftover PR link for previously disabled bwc tests Separate acquiring safe commit and last commit (elastic#28271) Fix BWC issue of the translog last modified age stats
2 parents 368f5f7 + 105dcb5 commit ba4d0a5

File tree

26 files changed

+420
-186
lines changed

26 files changed

+420
-186
lines changed

README.textile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ h3. Distributed, Highly Available
192192

193193
Let's face it, things will fail....
194194

195-
Elasticsearch is a highly available and distributed search engine. Each index is broken down into shards, and each shard can have one or more replica. By default, an index is created with 5 shards and 1 replica per shard (5/1). There are many topologies that can be used, including 1/10 (improve search performance), or 20/1 (improve indexing performance, with search executed in a map reduce fashion across shards).
195+
Elasticsearch is a highly available and distributed search engine. Each index is broken down into shards, and each shard can have one or more replicas. By default, an index is created with 5 shards and 1 replica per shard (5/1). There are many topologies that can be used, including 1/10 (improve search performance), or 20/1 (improve indexing performance, with search executed in a map reduce fashion across shards).
196196

197197
In order to play with the distributed nature of Elasticsearch, simply bring more nodes up and shut down nodes. The system will continue to serve requests (make sure you use the correct http port) with the latest data indexed.
198198

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ task verifyVersions {
145145
* after the backport of the backcompat code is complete.
146146
*/
147147
final boolean bwc_tests_enabled = true
148-
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/28673" /* place a PR link here when commiting bwc changes */
148+
final String bwc_tests_disabled_issue = "" /* place a PR link here when commiting bwc changes */
149149
if (bwc_tests_enabled == false) {
150150
if (bwc_tests_disabled_issue.isEmpty()) {
151151
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")

dev-tools/es_release_notes.pl

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131
">breaking", ">breaking-java", ">deprecation", ">feature",
3232
">enhancement", ">bug", ">regression", ">upgrade"
3333
);
34-
my %Ignore = map { $_ => 1 } (
35-
">non-issue", ">refactoring", ">docs", ">test", ":Core/Build"
36-
);
34+
my %Ignore = map { $_ => 1 }
35+
( ">non-issue", ">refactoring", ">docs", ">test", ":Core/Build" );
3736

3837
my %Group_Labels = (
3938
'>breaking' => 'Breaking changes',
@@ -70,6 +69,9 @@ sub dump_issues {
7069
my $issues = shift;
7170

7271
$version =~ s/v//;
72+
my $branch = $version;
73+
$branch =~ s/\.\d+$//;
74+
7375
my ( $day, $month, $year ) = (gmtime)[ 3 .. 5 ];
7476
$month++;
7577
$year += 1900;
@@ -81,12 +83,16 @@ sub dump_issues {
8183
[[release-notes-$version]]
8284
== $version Release Notes
8385
86+
coming[$version]
87+
88+
Also see <<breaking-changes-$branch>>.
89+
8490
ASCIIDOC
8591

8692
for my $group ( @Groups, 'other' ) {
8793
my $group_issues = $issues->{$group} or next;
8894
my $group_id = $group;
89-
$group_id=~s/^>//;
95+
$group_id =~ s/^>//;
9096
print "[[$group_id-$version]]\n"
9197
. "[float]\n"
9298
. "=== $Group_Labels{$group}\n\n";
@@ -162,14 +168,15 @@ sub fetch_issues {
162168
for my $issue (@issues) {
163169
next if $seen{ $issue->{number} } && !$issue->{pull_request};
164170

165-
for (@{ $issue->{labels} }) {
166-
next ISSUE if $Ignore{$_->{name}};
171+
for ( @{ $issue->{labels} } ) {
172+
next ISSUE if $Ignore{ $_->{name} };
167173
}
168174

169175
# uncomment for including/excluding PRs already issued in other versions
170176
# next if grep {$_->{name}=~/^v2/} @{$issue->{labels}};
171177
my %labels = map { $_->{name} => 1 } @{ $issue->{labels} };
172-
my ($header) = map { /:.+\/(.+)/ && $1 } grep {/^:/} sort keys %labels;
178+
my ($header) = map { m{:[^/]+/(.+)} && $1 }
179+
grep {/^:/} sort keys %labels;
173180
$header ||= 'NOT CLASSIFIED';
174181
for (@Groups) {
175182
if ( $labels{$_} ) {

docs/reference/cluster/nodes-stats.asciidoc

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ of `indices`, `os`, `process`, `jvm`, `transport`, `http`,
6262
Statistics about the discovery
6363

6464
`ingest`::
65-
Statistics about ingest preprocessing
65+
Statistics about ingest preprocessing
66+
67+
`adaptive_selection`::
68+
Statistics about <<search-adaptive-replica,adaptive replica selection>>. See
69+
<<adaptive-selection-stats,adaptive selection statistics>>.
6670

6771
[source,js]
6872
--------------------------------------------------
@@ -370,15 +374,43 @@ GET /_nodes/stats/indices?groups=foo,bar
370374
The `ingest` flag can be set to retrieve statistics that concern ingest:
371375

372376
`ingest.total.count`::
373-
The total number of document ingested during the lifetime of this node
377+
The total number of document ingested during the lifetime of this node
374378

375379
`ingest.total.time_in_millis`::
376-
The total time spent on ingest preprocessing documents during the lifetime of this node
380+
The total time spent on ingest preprocessing documents during the lifetime of this node
377381

378382
`ingest.total.current`::
379-
The total number of documents currently being ingested.
383+
The total number of documents currently being ingested.
380384

381385
`ingest.total.failed`::
382-
The total number ingest preprocessing operations failed during the lifetime of this node
386+
The total number ingest preprocessing operations failed during the lifetime of this node
383387

384388
On top of these overall ingest statistics, these statistics are also provided on a per pipeline basis.
389+
390+
[float]
391+
[[adaptive-selection-stats]]
392+
=== Adaptive selection statistics
393+
394+
The `adaptive_selection` flag can be set to retrieve statistics that concern
395+
<<search-adaptive-replica,adaptive replica selection>>. These statistics are
396+
keyed by node. For each node:
397+
398+
`adaptive_selection.outgoing_searches`::
399+
The number of outstanding search requests from the node these stats are for to
400+
the keyed node.
401+
402+
`avg_queue_size`::
403+
The exponentially weighted moving average queue size of search requests on the
404+
keyed node.
405+
406+
`avg_service_time_ns`::
407+
The exponentially weighted moving average service time of search requests on
408+
the keyed node.
409+
410+
`avg_response_time_ns`::
411+
The exponentially weighted moving average response time of search requests on
412+
the keyed node.
413+
414+
`rank`::
415+
The rank of this node; used for shard selection when routing search requests.
416+

docs/reference/setup/install/zip-windows.asciidoc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@ command line, or when installing Elasticsearch as a service for the
196196
first time. To adjust the heap size for an already installed service,
197197
use the service manager: `bin\elasticsearch-service.bat manager`.
198198

199+
NOTE: The service automatically configures a private temporary directory for use
200+
by Elasticsearch when it is running. This private temporary directory is
201+
configured as a sub-directory of the private temporary directory for the user
202+
running the installation. If the service will run under a different user, you
203+
can configure the location of the temporary directory that the service should
204+
use by setting the environment variable `ES_TMPDIR` to the preferred location
205+
before you execute the service installation.
206+
199207
Using the Manager GUI::
200208

201209
It is also possible to configure the service after it's been installed using the manager GUI (`elasticsearch-service-mgr.exe`), which offers insight into the installed service, including its status, startup type, JVM, start and stop settings amongst other things. Simply invoking `elasticsearch-service.bat manager` from the command-line will open up the manager window:
@@ -258,11 +266,6 @@ directory so that you do not delete important data later on.
258266
d| Not configured
259267
| path.repo
260268

261-
| script
262-
| Location of script files.
263-
| %ES_HOME%\scripts
264-
| path.scripts
265-
266269
|=======================================================================
267270

268271
include::next-steps.asciidoc[]

libs/elasticsearch-nio/src/main/java/org/elasticsearch/nio/SocketSelector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public void queueWrite(WriteOperation writeOperation) {
106106
if (isOpen() == false) {
107107
boolean wasRemoved = queuedWrites.remove(writeOperation);
108108
if (wasRemoved) {
109-
executeFailedListener(writeOperation.getListener(), new ClosedSelectorException());
109+
writeOperation.getListener().accept(null, new ClosedSelectorException());
110110
}
111111
} else {
112112
wakeup();

rest-api-spec/src/main/resources/rest-api-spec/test/indices.stats/20_translog.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ setup:
3333
# non empty generation with one op may be smaller or larger than that.
3434
# - gt: { indices.test.primaries.translog.uncommitted_size_in_bytes: $creation_size }
3535
- match: { indices.test.primaries.translog.uncommitted_operations: 1 }
36-
- gte: { indices.test.primaries.translog.earliest_last_modified_age: 0 }
3736

3837
- do:
3938
indices.flush:
@@ -47,7 +46,6 @@ setup:
4746
## creation translog size has some overhead due to an initial empty generation that will be trimmed later
4847
- lt: { indices.test.primaries.translog.uncommitted_size_in_bytes: $creation_size }
4948
- match: { indices.test.primaries.translog.uncommitted_operations: 0 }
50-
- gte: { indices.test.primaries.translog.earliest_last_modified_age: 0 }
5149

5250
- do:
5351
indices.put_settings:
@@ -69,4 +67,20 @@ setup:
6967
- match: { indices.test.primaries.translog.operations: 0 }
7068
- lte: { indices.test.primaries.translog.uncommitted_size_in_bytes: $creation_size }
7169
- match: { indices.test.primaries.translog.uncommitted_operations: 0 }
70+
71+
---
72+
"Translog last modified age stats":
73+
- skip:
74+
version: " - 6.2.99"
75+
reason: translog last modified age stats was added in 6.3.0
76+
- do:
77+
index:
78+
index: test
79+
type: bar
80+
id: 1
81+
body: { "foo": "bar" }
82+
83+
- do:
84+
indices.stats:
85+
metric: [ translog ]
7286
- gte: { indices.test.primaries.translog.earliest_last_modified_age: 0 }

server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsRequestBuilder.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,14 @@ public NodesStatsRequestBuilder setDiscovery(boolean discovery) {
138138
/**
139139
* Should ingest statistics be returned.
140140
*/
141-
public NodesStatsRequestBuilder ingest(boolean ingest) {
141+
public NodesStatsRequestBuilder setIngest(boolean ingest) {
142142
request.ingest(ingest);
143143
return this;
144144
}
145+
146+
public NodesStatsRequestBuilder setAdaptiveSelection(boolean adaptiveSelection) {
147+
request.adaptiveSelection(adaptiveSelection);
148+
return this;
149+
}
150+
145151
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ public SearchTransportService(Settings settings, TransportService transportServi
9595
this.responseWrapper = responseWrapper;
9696
}
9797

98-
public Map<String, Long> getClientConnections() {
99-
return Collections.unmodifiableMap(clientConnections);
100-
}
101-
10298
public void sendFreeContext(Transport.Connection connection, final long contextId, OriginalIndices originalIndices) {
10399
transportService.sendRequest(connection, FREE_CONTEXT_ACTION_NAME, new SearchFreeContextRequest(originalIndices, contextId),
104100
TransportRequestOptions.EMPTY, new ActionListenerResponseHandler<>(new ActionListener<SearchFreeContextResponse>() {

server/src/main/java/org/elasticsearch/index/engine/CombinedDeletionPolicy.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,10 @@ synchronized IndexCommit acquireIndexCommit(boolean acquiringSafeCommit) {
168168

169169
/**
170170
* Releases an index commit that acquired by {@link #acquireIndexCommit(boolean)}.
171+
*
172+
* @return true if the snapshotting commit can be clean up.
171173
*/
172-
synchronized void releaseCommit(final IndexCommit snapshotCommit) {
174+
synchronized boolean releaseCommit(final IndexCommit snapshotCommit) {
173175
final IndexCommit releasingCommit = ((SnapshotIndexCommit) snapshotCommit).delegate;
174176
assert snapshottedCommits.containsKey(releasingCommit) : "Release non-snapshotted commit;" +
175177
"snapshotted commits [" + snapshottedCommits + "], releasing commit [" + releasingCommit + "]";
@@ -178,6 +180,8 @@ synchronized void releaseCommit(final IndexCommit snapshotCommit) {
178180
if (refCount == 0) {
179181
snapshottedCommits.remove(releasingCommit);
180182
}
183+
// The commit can be clean up only if no pending snapshot and it is neither the safe commit nor last commit.
184+
return refCount == 0 && releasingCommit.equals(safeCommit) == false && releasingCommit.equals(lastCommit) == false;
181185
}
182186

183187
/**

0 commit comments

Comments
 (0)