Skip to content

Commit a3e152f

Browse files
committed
Merge remote-tracking branch 'elastic/master' into cache-deadlock
* elastic/master: Mute ML upgrade test (elastic#30458) Stop forking javac (elastic#30462) Client: Deprecate many argument performRequest (elastic#30315) Docs: Use task_id in examples of tasks (elastic#30436) Security: Rename IndexLifecycleManager to SecurityIndexManager (elastic#30442)
2 parents 9344ce7 + 4b36ea7 commit a3e152f

35 files changed

+218
-219
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

+9-4
Original file line numberDiff line numberDiff line change
@@ -497,10 +497,15 @@ class BuildPlugin implements Plugin<Project> {
497497
project.afterEvaluate {
498498
project.tasks.withType(JavaCompile) {
499499
final JavaVersion targetCompatibilityVersion = JavaVersion.toVersion(it.targetCompatibility)
500-
// we fork because compiling lots of different classes in a shared jvm can eventually trigger GC overhead limitations
501-
options.fork = true
502-
options.forkOptions.javaHome = new File(project.compilerJavaHome)
503-
options.forkOptions.memoryMaximumSize = "512m"
500+
final compilerJavaHomeFile = new File(project.compilerJavaHome)
501+
// we only fork if the Gradle JDK is not the same as the compiler JDK
502+
if (compilerJavaHomeFile.canonicalPath == Jvm.current().javaHome.canonicalPath) {
503+
options.fork = false
504+
} else {
505+
options.fork = true
506+
options.forkOptions.javaHome = compilerJavaHomeFile
507+
options.forkOptions.memoryMaximumSize = "512m"
508+
}
504509
if (targetCompatibilityVersion == JavaVersion.VERSION_1_8) {
505510
// compile with compact 3 profile by default
506511
// NOTE: this is just a compile time check: does not replace testing with a compact3 JRE

client/rest/src/main/java/org/elasticsearch/client/RestClient.java

+16
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ public void performRequestAsync(Request request, ResponseListener responseListen
210210
* @throws IOException in case of a problem or the connection was aborted
211211
* @throws ClientProtocolException in case of an http protocol error
212212
* @throws ResponseException in case Elasticsearch responded with a status code that indicated an error
213+
* @deprecated prefer {@link #performRequest(Request)}
213214
*/
215+
@Deprecated
214216
public Response performRequest(String method, String endpoint, Header... headers) throws IOException {
215217
Request request = new Request(method, endpoint);
216218
request.setHeaders(headers);
@@ -229,7 +231,9 @@ public Response performRequest(String method, String endpoint, Header... headers
229231
* @throws IOException in case of a problem or the connection was aborted
230232
* @throws ClientProtocolException in case of an http protocol error
231233
* @throws ResponseException in case Elasticsearch responded with a status code that indicated an error
234+
* @deprecated prefer {@link #performRequest(Request)}
232235
*/
236+
@Deprecated
233237
public Response performRequest(String method, String endpoint, Map<String, String> params, Header... headers) throws IOException {
234238
Request request = new Request(method, endpoint);
235239
addParameters(request, params);
@@ -252,7 +256,9 @@ public Response performRequest(String method, String endpoint, Map<String, Strin
252256
* @throws IOException in case of a problem or the connection was aborted
253257
* @throws ClientProtocolException in case of an http protocol error
254258
* @throws ResponseException in case Elasticsearch responded with a status code that indicated an error
259+
* @deprecated prefer {@link #performRequest(Request)}
255260
*/
261+
@Deprecated
256262
public Response performRequest(String method, String endpoint, Map<String, String> params,
257263
HttpEntity entity, Header... headers) throws IOException {
258264
Request request = new Request(method, endpoint);
@@ -289,7 +295,9 @@ public Response performRequest(String method, String endpoint, Map<String, Strin
289295
* @throws IOException in case of a problem or the connection was aborted
290296
* @throws ClientProtocolException in case of an http protocol error
291297
* @throws ResponseException in case Elasticsearch responded with a status code that indicated an error
298+
* @deprecated prefer {@link #performRequest(Request)}
292299
*/
300+
@Deprecated
293301
public Response performRequest(String method, String endpoint, Map<String, String> params,
294302
HttpEntity entity, HttpAsyncResponseConsumerFactory httpAsyncResponseConsumerFactory,
295303
Header... headers) throws IOException {
@@ -310,7 +318,9 @@ public Response performRequest(String method, String endpoint, Map<String, Strin
310318
* @param endpoint the path of the request (without host and port)
311319
* @param responseListener the {@link ResponseListener} to notify when the request is completed or fails
312320
* @param headers the optional request headers
321+
* @deprecated prefer {@link #performRequestAsync(Request, ResponseListener)}
313322
*/
323+
@Deprecated
314324
public void performRequestAsync(String method, String endpoint, ResponseListener responseListener, Header... headers) {
315325
Request request;
316326
try {
@@ -333,7 +343,9 @@ public void performRequestAsync(String method, String endpoint, ResponseListener
333343
* @param params the query_string parameters
334344
* @param responseListener the {@link ResponseListener} to notify when the request is completed or fails
335345
* @param headers the optional request headers
346+
* @deprecated prefer {@link #performRequestAsync(Request, ResponseListener)}
336347
*/
348+
@Deprecated
337349
public void performRequestAsync(String method, String endpoint, Map<String, String> params,
338350
ResponseListener responseListener, Header... headers) {
339351
Request request;
@@ -361,7 +373,9 @@ public void performRequestAsync(String method, String endpoint, Map<String, Stri
361373
* @param entity the body of the request, null if not applicable
362374
* @param responseListener the {@link ResponseListener} to notify when the request is completed or fails
363375
* @param headers the optional request headers
376+
* @deprecated prefer {@link #performRequestAsync(Request, ResponseListener)}
364377
*/
378+
@Deprecated
365379
public void performRequestAsync(String method, String endpoint, Map<String, String> params,
366380
HttpEntity entity, ResponseListener responseListener, Header... headers) {
367381
Request request;
@@ -394,7 +408,9 @@ public void performRequestAsync(String method, String endpoint, Map<String, Stri
394408
* connection on the client side.
395409
* @param responseListener the {@link ResponseListener} to notify when the request is completed or fails
396410
* @param headers the optional request headers
411+
* @deprecated prefer {@link #performRequestAsync(Request, ResponseListener)}
397412
*/
413+
@Deprecated
398414
public void performRequestAsync(String method, String endpoint, Map<String, String> params,
399415
HttpEntity entity, HttpAsyncResponseConsumerFactory httpAsyncResponseConsumerFactory,
400416
ResponseListener responseListener, Header... headers) {

docs/CHANGELOG.asciidoc

+8-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[partintro]
55
--
6-
// To add a release, copy and paste the template text
6+
// To add a release, copy and paste the template text
77
// and add a link to the new section. Note that release subheads must
88
// be floated and sections cannot be empty.
99

@@ -139,8 +139,11 @@ coming[6.4.0]
139139
//[float]
140140
//=== Breaking Java Changes
141141

142-
//[float]
143-
//=== Deprecations
142+
[float]
143+
=== Deprecations
144+
145+
Deprecated multi-argument versions of the request methods in the RestClient.
146+
Prefer the "Request" object flavored methods. ({pull}30315[#30315])
144147

145148
[float]
146149
=== New Features
@@ -157,8 +160,8 @@ analysis module. ({pull}30397[#30397])
157160

158161
{ref-64}/breaking_64_api_changes.html#copy-source-settings-on-resize[Allow copying source settings on index resize operations] ({pull}30255[#30255])
159162

160-
Added new "Request" object flavored request methods. Prefer these instead of the
161-
multi-argument versions. ({pull}29623[#29623])
163+
Added new "Request" object flavored request methods in the RestClient. Prefer
164+
these instead of the multi-argument versions. ({pull}29623[#29623])
162165

163166
The cluster state listener to decide if watcher should be
164167
stopped/started/paused now runs far less code in an executor but is more

docs/reference/cluster/tasks.asciidoc

+4-2
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ It is also possible to retrieve information for a particular task:
6464

6565
[source,js]
6666
--------------------------------------------------
67-
GET _tasks/task_id:1 <1>
67+
GET _tasks/task_id <1>
6868
--------------------------------------------------
6969
// CONSOLE
70+
// TEST[s/task_id/node_id:1/]
7071
// TEST[catch:missing]
7172

7273
<1> This will return a 404 if the task isn't found.
@@ -75,9 +76,10 @@ Or to retrieve all children of a particular task:
7576

7677
[source,js]
7778
--------------------------------------------------
78-
GET _tasks?parent_task_id=parentTaskId:1 <1>
79+
GET _tasks?parent_task_id=parent_task_id <1>
7980
--------------------------------------------------
8081
// CONSOLE
82+
// TEST[s/=parent_task_id/=node_id:1/]
8183

8284
<1> This won't return a 404 if the parent isn't found.
8385

docs/reference/docs/delete-by-query.asciidoc

+6-3
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,10 @@ With the task id you can look up the task directly:
357357

358358
[source,js]
359359
--------------------------------------------------
360-
GET /_tasks/taskId:1
360+
GET /_tasks/task_id
361361
--------------------------------------------------
362362
// CONSOLE
363+
// TEST[s/task_id/node_id:1/]
363364
// TEST[catch:missing]
364365

365366
The advantage of this API is that it integrates with `wait_for_completion=false`
@@ -378,8 +379,9 @@ Any Delete By Query can be canceled using the <<tasks,Task Cancel API>>:
378379

379380
[source,js]
380381
--------------------------------------------------
381-
POST _tasks/task_id:1/_cancel
382+
POST _tasks/task_id/_cancel
382383
--------------------------------------------------
384+
// TEST[s/task_id/node_id:1/]
383385
// CONSOLE
384386

385387
The `task_id` can be found using the tasks API above.
@@ -397,8 +399,9 @@ using the `_rethrottle` API:
397399

398400
[source,js]
399401
--------------------------------------------------
400-
POST _delete_by_query/task_id:1/_rethrottle?requests_per_second=-1
402+
POST _delete_by_query/task_id/_rethrottle?requests_per_second=-1
401403
--------------------------------------------------
404+
// TEST[s/task_id/node_id:1/]
402405
// CONSOLE
403406

404407
The `task_id` can be found using the tasks API above.

docs/reference/docs/reindex.asciidoc

+6-3
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,10 @@ With the task id you can look up the task directly:
740740

741741
[source,js]
742742
--------------------------------------------------
743-
GET /_tasks/taskId:1
743+
GET /_tasks/task_id
744744
--------------------------------------------------
745745
// CONSOLE
746+
// TEST[s/task_id/node_id:1/]
746747
// TEST[catch:missing]
747748

748749
The advantage of this API is that it integrates with `wait_for_completion=false`
@@ -761,9 +762,10 @@ Any Reindex can be canceled using the <<tasks,Task Cancel API>>:
761762

762763
[source,js]
763764
--------------------------------------------------
764-
POST _tasks/task_id:1/_cancel
765+
POST _tasks/task_id/_cancel
765766
--------------------------------------------------
766767
// CONSOLE
768+
// TEST[s/task_id/node_id:1/]
767769

768770
The `task_id` can be found using the Tasks API.
769771

@@ -780,9 +782,10 @@ the `_rethrottle` API:
780782

781783
[source,js]
782784
--------------------------------------------------
783-
POST _reindex/task_id:1/_rethrottle?requests_per_second=-1
785+
POST _reindex/task_id/_rethrottle?requests_per_second=-1
784786
--------------------------------------------------
785787
// CONSOLE
788+
// TEST[s/task_id/node_id:1/]
786789

787790
The `task_id` can be found using the Tasks API above.
788791

docs/reference/docs/update-by-query.asciidoc

+6-3
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,10 @@ With the task id you can look up the task directly:
415415

416416
[source,js]
417417
--------------------------------------------------
418-
GET /_tasks/taskId:1
418+
GET /_tasks/task_id
419419
--------------------------------------------------
420420
// CONSOLE
421+
// TEST[s/task_id/node_id:1/]
421422
// TEST[catch:missing]
422423

423424
The advantage of this API is that it integrates with `wait_for_completion=false`
@@ -436,9 +437,10 @@ Any Update By Query can be canceled using the <<tasks,Task Cancel API>>:
436437

437438
[source,js]
438439
--------------------------------------------------
439-
POST _tasks/task_id:1/_cancel
440+
POST _tasks/task_id/_cancel
440441
--------------------------------------------------
441442
// CONSOLE
443+
// TEST[s/task_id/node_id:1/]
442444

443445
The `task_id` can be found using the tasks API above.
444446

@@ -455,9 +457,10 @@ using the `_rethrottle` API:
455457

456458
[source,js]
457459
--------------------------------------------------
458-
POST _update_by_query/task_id:1/_rethrottle?requests_per_second=-1
460+
POST _update_by_query/task_id/_rethrottle?requests_per_second=-1
459461
--------------------------------------------------
460462
// CONSOLE
463+
// TEST[s/task_id/node_id:1/]
461464

462465
The `task_id` can be found using the tasks API above.
463466

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
import org.elasticsearch.xpack.security.rest.action.user.RestHasPrivilegesAction;
198198
import org.elasticsearch.xpack.security.rest.action.user.RestPutUserAction;
199199
import org.elasticsearch.xpack.security.rest.action.user.RestSetEnabledAction;
200-
import org.elasticsearch.xpack.security.support.IndexLifecycleManager;
200+
import org.elasticsearch.xpack.security.support.SecurityIndexManager;
201201
import org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor;
202202
import org.elasticsearch.xpack.security.transport.filter.IPFilter;
203203
import org.elasticsearch.xpack.security.transport.netty4.SecurityNetty4HttpServerTransport;
@@ -233,7 +233,7 @@
233233
import static org.elasticsearch.xpack.core.XPackSettings.HTTP_SSL_ENABLED;
234234
import static org.elasticsearch.xpack.core.security.SecurityLifecycleServiceField.SECURITY_TEMPLATE_NAME;
235235
import static org.elasticsearch.xpack.security.SecurityLifecycleService.SECURITY_INDEX_NAME;
236-
import static org.elasticsearch.xpack.security.support.IndexLifecycleManager.INTERNAL_INDEX_FORMAT;
236+
import static org.elasticsearch.xpack.security.support.SecurityIndexManager.INTERNAL_INDEX_FORMAT;
237237

238238
public class Security extends Plugin implements ActionPlugin, IngestPlugin, NetworkPlugin, ClusterPlugin,
239239
DiscoveryPlugin, MapperPlugin, ExtensiblePlugin {
@@ -424,8 +424,8 @@ Collection<Object> createComponents(Client client, ThreadPool threadPool, Cluste
424424
components.add(realms);
425425
components.add(reservedRealm);
426426

427-
securityLifecycleService.addSecurityIndexHealthChangeListener(nativeRoleMappingStore::onSecurityIndexHealthChange);
428-
securityLifecycleService.addSecurityIndexOutOfDateListener(nativeRoleMappingStore::onSecurityIndexOutOfDateChange);
427+
securityLifecycleService.securityIndex().addIndexHealthChangeListener(nativeRoleMappingStore::onSecurityIndexHealthChange);
428+
securityLifecycleService.securityIndex().addIndexOutOfDateListener(nativeRoleMappingStore::onSecurityIndexOutOfDateChange);
429429

430430
AuthenticationFailureHandler failureHandler = null;
431431
String extensionName = null;
@@ -458,8 +458,8 @@ Collection<Object> createComponents(Client client, ThreadPool threadPool, Cluste
458458
}
459459
final CompositeRolesStore allRolesStore = new CompositeRolesStore(settings, fileRolesStore, nativeRolesStore,
460460
reservedRolesStore, rolesProviders, threadPool.getThreadContext(), getLicenseState());
461-
securityLifecycleService.addSecurityIndexHealthChangeListener(allRolesStore::onSecurityIndexHealthChange);
462-
securityLifecycleService.addSecurityIndexOutOfDateListener(allRolesStore::onSecurityIndexOutOfDateChange);
461+
securityLifecycleService.securityIndex().addIndexHealthChangeListener(allRolesStore::onSecurityIndexHealthChange);
462+
securityLifecycleService.securityIndex().addIndexOutOfDateListener(allRolesStore::onSecurityIndexOutOfDateChange);
463463
// to keep things simple, just invalidate all cached entries on license change. this happens so rarely that the impact should be
464464
// minimal
465465
getLicenseState().addListener(allRolesStore::invalidateAll);
@@ -886,7 +886,7 @@ public UnaryOperator<Map<String, IndexTemplateMetaData>> getIndexTemplateMetaDat
886886
templates.remove(SECURITY_TEMPLATE_NAME);
887887
final XContent xContent = XContentFactory.xContent(XContentType.JSON);
888888
final byte[] auditTemplate = TemplateUtils.loadTemplate("/" + IndexAuditTrail.INDEX_TEMPLATE_NAME + ".json",
889-
Version.CURRENT.toString(), IndexLifecycleManager.TEMPLATE_VERSION_PATTERN).getBytes(StandardCharsets.UTF_8);
889+
Version.CURRENT.toString(), SecurityIndexManager.TEMPLATE_VERSION_PATTERN).getBytes(StandardCharsets.UTF_8);
890890

891891
try (XContentParser parser = xContent
892892
.createParser(NamedXContentRegistry.EMPTY, LoggingDeprecationHandler.INSTANCE, auditTemplate)) {

0 commit comments

Comments
 (0)