[Upgrade Assistant] Open And Close Slight Refactor#59890
Merged
jloleysens merged 5 commits intoelastic:masterfrom Mar 12, 2020
Merged
[Upgrade Assistant] Open And Close Slight Refactor#59890jloleysens merged 5 commits intoelastic:masterfrom
jloleysens merged 5 commits intoelastic:masterfrom
Conversation
We should rather only check if an index is currently closed the moment before starting to reindex. We still store a flag to indicate that we opened an index that was closed, but this should not be set from the reindex handlers because the reindex task may only start some time later in which case the closed index could have been opened and our reindex job will open it and close it again.
Contributor
|
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
Contributor
Author
|
@elasticmachine merge upstream |
cjcenizal
reviewed
Mar 11, 2020
| const { indexName, reindexOptions } = reindexOp.attributes; | ||
|
|
||
| if (reindexOptions?.openAndClose === true) { | ||
| const indicesState = await esIndicesStateCheck(callAsUser, [indexName]); |
Contributor
There was a problem hiding this comment.
Is it worth adding a comment here to reflect your thoughts in the PR description? For example:
// Where possible, derive reindex options at the last moment before reindexing
// to prevent them from becoming stale as they wait in the queue.
alisonelizabeth
approved these changes
Mar 11, 2020
Contributor
alisonelizabeth
left a comment
There was a problem hiding this comment.
Code changes LGTM. I tested again using the description provided in #58890, and validated everything is still working as expected.
Contributor
Author
|
@elasticmachine merge upstream |
jloleysens
added a commit
to jloleysens/kibana
that referenced
this pull request
Mar 12, 2020
* Refactor: Move checking of closed index to single point We should rather only check if an index is currently closed the moment before starting to reindex. We still store a flag to indicate that we opened an index that was closed, but this should not be set from the reindex handlers because the reindex task may only start some time later in which case the closed index could have been opened and our reindex job will open it and close it again. * Added debug log * Added comment Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Contributor
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
jloleysens
added a commit
that referenced
this pull request
Mar 12, 2020
* Refactor: Move checking of closed index to single point We should rather only check if an index is currently closed the moment before starting to reindex. We still store a flag to indicate that we opened an index that was closed, but this should not be set from the reindex handlers because the reindex task may only start some time later in which case the closed index could have been opened and our reindex job will open it and close it again. * Added debug log * Added comment Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris
added a commit
to gmmorris/kibana
that referenced
this pull request
Mar 12, 2020
* master: (45 commits) skip flaky suite (elastic#59717) UI Metrics use findAll to retrieve all Saved Objects (elastic#59891) [Discover] Migrate Context mocha tests to use Jest (elastic#59658) [Maps] Move redux reducers and store logic to NP (elastic#58294) rebalance x-pack groups (elastic#58930) [Discover] Reimplement $route.reload when index pattern changes (elastic#59877) [Upgrade Assistant Meta] Breaking changes issue template (elastic#59745) Skip CI based on changes in PR (elastic#59939) [ML] Transforms: Replace KqlFilterBar with QueryStringInput. (elastic#59723) [ML] Functional tests - stabilize date_nanos test (elastic#59986) [ML] Typescripting client side endpoint functions (elastic#59928) a11y tests on adding columns to discover table (elastic#59375) fix graph plugin config path (elastic#59540) fix vega config issues (elastic#59737) [Upgrade Assistant] Open And Close Slight Refactor (elastic#59890) [ML] Adding shared services to ml setup contract (elastic#59730) [Visualize] Fix linked search behavior (elastic#59690) [ML] Register NP ML plugin for Kibana management section. (elastic#59762) [Lens] Adds using queries/filters for field existence endpoint (elastic#59033) Delete FilterStateManager and QueryFilter :-D (elastic#59872) ...
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
After merging #58890, I realised that if we set
openAndCloseon a reindex operation when it gets created and that reindex operation waits on a queue for a long time the edge case could arise that the index is opened before it is processed by the reindex worker. In that situation the reindex service would read the reindex options, attempt to open the already open index (which is fine) and then later close the open index which it thought it opened, leaving the open index closed again.This PR just moves the point at which we check for the index being closed to just before it is reindexed to reduce the chances of this happening.