-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Upgrade Assistant] First iteration of batch reindex docs #59887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| [[batch-reindex-queue]] | ||
| === Batch reindex queue API | ||
| ++++ | ||
| <titleabbrev>Batch reindex queue</titleabbrev> | ||
| ++++ | ||
|
|
||
| Check the current reindex batch queue. | ||
|
|
||
| experimental["The underlying Upgrade Assistant concepts are stable, but the APIs for managing Upgrade Assistant are experimental."] | ||
jloleysens marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| [[batch-reindex-queue-request]] | ||
| ==== Request | ||
|
|
||
| `GET /api/upgrade_assistant/reindex/batch/queue` | ||
|
|
||
| [[batch-reindex-queue-request-codes]] | ||
| ==== Response code | ||
|
|
||
| `200`:: | ||
| Indicates a successful call. | ||
|
|
||
| [[batch-reindex-queue-example]] | ||
| ==== Example | ||
|
|
||
| The API returns the following: | ||
|
|
||
| [source,js] | ||
| -------------------------------------------------- | ||
| { | ||
| "queue": [ <1> | ||
| { | ||
| "indexName": "index1", | ||
| "newIndexName": "reindexed-v8-index2", | ||
| "status": 3, | ||
| "lastCompletedStep": 0, | ||
| "locked": null, | ||
| "reindexTaskId": null, | ||
| "reindexTaskPercComplete": null, | ||
| "errorMessage": null, | ||
| "runningReindexCount": null, | ||
| "reindexOptions": { | ||
| "queueSettings": { | ||
| "queuedAt": 1583406985489 | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "indexName": "index2", | ||
| "newIndexName": "reindexed-v8-index2", | ||
| "status": 3, | ||
| "lastCompletedStep": 0, | ||
| "locked": null, | ||
| "reindexTaskId": null, | ||
| "reindexTaskPercComplete": null, | ||
| "errorMessage": null, | ||
| "runningReindexCount": null, | ||
| "reindexOptions": { | ||
| "queueSettings": { | ||
| "queuedAt": 1583406987334 | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| -------------------------------------------------- | ||
|
|
||
| <1> Items in this array indicate reindex tasks at a given point in time | ||
jloleysens marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| [[batch-start-resume-reindex]] | ||
| === Batch start or resume reindex API | ||
| ++++ | ||
| <titleabbrev>Batch start or resume reindex</titleabbrev> | ||
| ++++ | ||
|
|
||
| Enables starting or resuming multiple reindexing tasks in one request. Additionally, reindexing tasks started or resumed | ||
jloleysens marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
jloleysens marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| via the batch endpoint will be placed on a queue and executed one-by-one which ensures that minimal cluster resources | ||
jloleysens marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| are consumed over time. | ||
|
|
||
| experimental["The underlying Upgrade Assistant concepts are stable, but the APIs for managing Upgrade Assistant are experimental."] | ||
jloleysens marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| [[batch-start-resume-reindex-request]] | ||
| ==== Request | ||
|
|
||
| `POST /api/upgrade_assistant/reindex/batch` | ||
|
|
||
| [[batch-start-resume-reindex-request-body]] | ||
| ==== Request body | ||
|
|
||
| `indexNames`:: | ||
| (Required, array) The list of index names to be reindexed. | ||
|
|
||
| [[batch-start-resume-reindex-codes]] | ||
| ==== Response code | ||
|
|
||
| `200`:: | ||
| Indicates a successful call. | ||
|
|
||
| [[batch-start-resume-example]] | ||
| ==== Example | ||
|
|
||
| [source,js] | ||
| -------------------------------------------------- | ||
| POST /api/upgrade_assistant/reindex/batch | ||
| { | ||
| "indexNames": [ <1> | ||
| "index1", | ||
| "index2" | ||
| ] | ||
| } | ||
| -------------------------------------------------- | ||
| <1> The order in which the indices are provided here determines the order in which the reindex tasks will be executed. | ||
|
|
||
| The API returns the following which is similar to the <<start-resume-reindex, start or resume endpoint>>: | ||
jloleysens marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| [source,js] | ||
| -------------------------------------------------- | ||
| { | ||
| "enqueued": [ <1> | ||
| { | ||
| "indexName": "index1", | ||
| "newIndexName": "reindexed-v8-index1", | ||
| "status": 3, | ||
| "lastCompletedStep": 0, | ||
| "locked": null, | ||
| "reindexTaskId": null, | ||
| "reindexTaskPercComplete": null, | ||
| "errorMessage": null, | ||
| "runningReindexCount": null, | ||
| "reindexOptions": { <2> | ||
| "queueSettings": { | ||
| "queuedAt": 1583406985489 <3> | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "errors": [ <4> | ||
| { | ||
| "indexName": "index2", | ||
| "message": "Something went wrong!" | ||
| } | ||
| ] | ||
| } | ||
| -------------------------------------------------- | ||
|
|
||
| <1> A list of reindex operations created, the order in the array indicates the order in which tasks will be executed. | ||
| <2> Presence of this key indicates that the reindex job will occur in the batch. | ||
| <3> A Unix timestamp of when the reindex task was placed in the queue. | ||
| <4> A list of errors that may have occurred preventing the reindex task from being created. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.