-
Notifications
You must be signed in to change notification settings - Fork 697
MB-57888: Support for downtime mitigation upon updates to index mapping #2106
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 all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
ab40135
MB-57888: Index Update
Likith101 7740e0f
MB-57888: New apis for index update
Likith101 62271b2
MB-57888: Added few missing checks for index update
Likith101 d295df8
MB-57888: Added unit tests covering all update paths
Likith101 2e96445
MB-57888: Minor Fixes
Likith101 0410448
MB-57888: Naming changes
Likith101 4c5dd0b
MB-57888: Added analyser and datetime parser checks
Likith101 53eebc8
MB-57888: Additional checks for synonyms
Likith101 d5c4489
MB-57888: Api changes
Likith101 41ffb3b
MB-57888: Minor Code Refactoring
Likith101 1611ac5
MB-57888: Addressing review comments
Likith101 a18fe6f
MB-57888: Fixed typo
Likith101 829d502
MB-57888: Addressing review comments
Likith101 b65b4aa
MB-57888: Added checks for all dynamic mappings' analysers and dateti…
Likith101 2ff5417
MB-57888: Adding documentation and addressing review comments
Likith101 3d6cf2f
MB-57888: Addressing review comments and race conditions
Likith101 00d75b2
Absorb dependent zapx, scorch_segment_api, bleve_index_api commits
abhinavdangeti 3dadd2d
Merge branch 'master' into IndexUpdate
abhinavdangeti 96663d4
Fix missing refactor for PutUpdatedFields -> SetUpdatedFields
abhinavdangeti 9891276
Use zapx/v16's v16.2.5
abhinavdangeti a4fbb0c
Fixing few test issues
Likith101 7fcbf77
Minor Changes
Likith101 4fab6ba
Addressing review comments
Likith101 0f10286
Merge branch 'master' into IndexUpdate
abhinavdangeti 61c5adc
Addressing review comments
Likith101 c0f8c16
Addressing review comments
Likith101 29ff859
Adding commentary
Likith101 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,41 @@ | ||
| # Ability to reduce downtime during index mapping updates | ||
|
|
||
| * *v2.5.4* (and after) will come with support to delete or modify any field mapping in the index mapping without requiring a full rebuild of the index | ||
| * We do this by storing which portions of the field has to be deleted within zap and then lazily executing the deletion during subsequent merging of the segments | ||
|
|
||
| ## Usage | ||
|
|
||
| While opening an index, if an updated mapping is provided as a string under the key `updated_mapping` within the `runtimeConfig` parameter of `OpenUsing`, then we open the index and try to update it to use the new mapping provided. | ||
|
|
||
| If the update fails, the index is unchanged and an error is returned explaining why the update was unsuccessful. | ||
|
|
||
| ## What can be deleted and what can't be deleted? | ||
| Fields can be partially deleted by changing their Index, Store, and DocValues parameters from true to false, or completely removed by deleting the field itself. | ||
|
|
||
| Additionally, document mappings can be deleted either by fully removing them from the index mapping or by setting the Enabled value to false, which deletes all fields defined within that mapping. | ||
|
|
||
| However, if any of the following conditions are met, the index is considered non-updatable. | ||
| * Any additional fields or enabled document mappings in the new index mapping | ||
| * Any changes to IncludeInAll, type, IncludeTermVectors and SkipFreqNorm | ||
| * Any document mapping having it's enabled value changing from false to true | ||
| * Text fields with a different analyser or date time fields with a different date time format | ||
| * Vector and VectorBase64 fields changing dims, similarity or vectorIndexOptimizedFor | ||
| * Any changes when field is part of `_all` | ||
| * Full field deletions when it is covered by any dynamic setting (Index, Store or DocValues Dynamic) | ||
| * Any changes to dynamic settings at the top level or any enabled document mapping | ||
| * If multiple fields sharing the same field name either from different type mappings or aliases are present, then any non compatible changes across all of these fields | ||
|
|
||
| ## How to enforce immediate deletion? | ||
| Since the deletion is only done during merging, a [force merge](https://github.com/blevesearch/bleve/blob/b82baf10b205511cf12da5cb24330abd9f5b1b74/index/scorch/merge.go#L164) may be used to completely remove the stale data. | ||
|
|
||
| ## Sample code to update an existing index | ||
| ``` | ||
| newMapping := `<Updated Index Mapping>` | ||
| config := map[string]interface{}{ | ||
| "updated_mapping": newMapping | ||
| } | ||
| index, err := OpenUsing("<Path to Index>", config) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| ``` | ||
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
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
Oops, something went wrong.
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.