Skip to content

Conversation

@szybia
Copy link
Contributor

@szybia szybia commented Jan 12, 2026

  • follow-on from adding reindex cancel endpoint: Add disabled POST _reindex/{taskId}/_cancel API #139211
  • create new reindex-management/qa tests module
    • same pattern from other multi-project tests
    • disabled in release builds
  • add test that calls cancel from two projects: one that doesn't contain the reindex task and therefore fails, and one that does contain the reindex task and succeeds
    • DEFAULT is implicitly tested in existing IT
    • test fails if i remove the super.match() in previous PR that checks project-ownership in TransportTasksProjectAction

@szybia szybia changed the title Add multi-project tests for reindex cancellation Add multi-project test for reindex cancellation Jan 12, 2026
@szybia szybia marked this pull request as ready for review January 12, 2026 14:21
@szybia szybia added >non-issue :Distributed Indexing/Reindex Issues relating to reindex that are not caused by issues further down labels Jan 12, 2026
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Indexing Meta label for Distributed Indexing team label Jan 12, 2026
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing)

Copy link
Member

@PeteGillinElastic PeteGillinElastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM, with a couple of comments. The nits you can ignore if you like, but hopefully the suggested base class change will work and simplify this.


import static org.hamcrest.Matchers.equalTo;

public class ReindexCancelMultiProjectIT extends ESRestTestCase {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should extend MultiProjectRestTestCase instead. This will save you a bunch of work: you don't need to override shouldConfigureProjects, you don't need removeNonDefaultProjects, and you can use setRequestProjectId as a helper instead of your method of the same name. (I don't think I'm missing any reason why this wouldn't work?)

Copy link
Contributor Author

@szybia szybia Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great point!

i already tried this and found this:

  1. MultiProjectRestTestCase exists in test/external-modules/multi-project/src/javaRestTest/...
  2. all classes that extend that class exist in same "place":
~/repos/elasticsearch $ rg -l 'extends MultiProjectRestTestCase'
test/external-modules/multi-project/src/javaRestTest/java/org/elasticsearch/action/index/IndexDocumentMultiProjectIT.java
test/external-modules/multi-project/src/javaRestTest/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsMultiProjectIT.java
test/external-modules/multi-project/src/javaRestTest/java/org/elasticsearch/action/admin/indices/SearchMultiProjectIT.java
test/external-modules/multi-project/src/javaRestTest/java/org/elasticsearch/action/admin/indices/IndexMultiProjectCRUDIT.java
test/external-modules/multi-project/src/javaRestTest/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsMultiProjectIT.java
test/external-modules/multi-project/src/javaRestTest/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsMultiProjectIT.java
test/external-modules/multi-project/src/javaRestTest/java/org/elasticsearch/multiproject/MultiProjectRestartIT.java
test/external-modules/multi-project/src/javaRestTest/java/org/elasticsearch/multiproject/action/ProjectCrudActionIT.java
test/external-modules/multi-project/src/javaRestTest/java/org/elasticsearch/multiproject/MultiProjectClusterStateActionIT.java
test/external-modules/multi-project/src/javaRestTest/java/org/elasticsearch/xpack/security/SecurityRolesMultiProjectIT.java

so (as a person still wrapping their mind around gradle/ES deps), commentating:

  1. all other multi-project tests i can find (ctrl-f .setting("test.multi_project.enabled", "true")) just use EsRestTestCase
  2. importing other modules javaRestTests sounds nonsensical (also can't find an example, but maybe need guidance), and we'd have to export them somehow
  3. could do something around putting this into somewhere shared (sounds more sensible), sounds a bit out of scope for me (but i could be being lazy here)

pushed and going to set auto-merge before i sign off and can adjust in a follow-up PR if we need changes here

thoughts? 🙏

Copy link
Contributor

@samxbr samxbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

…i-project-tests

* upstream/main: (23 commits)
  Fix `testAckListenerReceivesNacksIfPublicationTimesOut` (elastic#140514)
  Reduce priority of clear-cache tasks (elastic#139685)
  Add docs and tests about `StreamOutput` to memory (elastic#140365)
  ES|QL - dense_vector support for COUNT, PRESENT, ABSENT aggregator functions (elastic#139914)
  Add release notes for v9.2.4 release (elastic#140487)
  Add release notes for v9.1.10 release (elastic#140488)
  Add conncectors release notes for 9.1.10, 9.2.4 (elastic#140499)
  Add parameter support in PromQL query durations (elastic#139873)
  Improve testing of STS credentials reloading (elastic#140114)
  Fix zstd native binary publishing script to support newer versions (elastic#140485)
  Add FlattenedFieldBinaryVsSortedSetDocValuesSyntheticSourceIT (elastic#140489)
  Store fallback match only text fields in binary doc values (elastic#140189)
  [DiskBBQ] Use the new merge executor for intra-merge parallelism (elastic#139942)
  ESQL: introduce support for mapping-unavailable fields (elastic#140463)
  Add ESNextOSQVectorsScorerTests (elastic#140436)
  Disable high cardinality tests on release builds (elastic#140503)
  ESQL: TRange timezone support (elastic#139911)
  Directly compressing `StreamOutput` (elastic#140502)
  ES|QL - fix dense vector enrich bug (elastic#139774)
  Use CrossProjectModeDecider in RemoteClusterService (elastic#140481)
  ...
@szybia szybia enabled auto-merge (squash) January 12, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Indexing/Reindex Issues relating to reindex that are not caused by issues further down >non-issue Team:Distributed Indexing Meta label for Distributed Indexing team v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants