-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ILM] Data tiers for 7.10 #76126
Merged
jloleysens
merged 62 commits into
elastic:master
from
jloleysens:ilm/data-tiers-for-710
Sep 18, 2020
Merged
[ILM] Data tiers for 7.10 #76126
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
b2c509c
wip
jloleysens 51f8ebc
Revert "wip"
jloleysens 579d003
Revert "Revert "wip""
jloleysens 723db09
Refactor to using EUI button group component
jloleysens f844efc
WIP: moved form UX more in line with EUI
jloleysens f51a081
Refactor UI to reflect custom-ness of "Custom" and "None" options
jloleysens a97f6b7
server side changes for getting node data
jloleysens c6e7f91
double opt-in
jloleysens 174a82d
Merge branch 'master' of github.com:elastic/kibana into ilm/data-tier…
jloleysens 520b167
Refactored data tier allocation type
jloleysens 89da532
Some refacoring, but main point is to add warning detection for
jloleysens bda6d0a
Merge branch 'master' into ilm/data-tiers-for-710
elasticmachine 4f54d5b
fix i18n
jloleysens 78e64ce
fix type issue with deafult policies missing allocation type
jloleysens 5a6dc06
remove "undefined" as option for setting phase data
jloleysens bba846e
Create referentially stable data setter for all phases - prevent infi…
jloleysens 17a4d95
fix type issue
jloleysens afba9f0
refactor data -> nodesData
jloleysens a736c65
refactor cold phase for data tiers
jloleysens 2790121
refactor frozen phase for data tiers
jloleysens 93a02b2
fixed existing tests for warm section
jloleysens b0a9b20
restored existing test coverage for cold phase and added test coverag…
jloleysens 2302a1d
fix api integration test
jloleysens 91d06ca
remove unused translations
jloleysens b052ce7
Merge branch 'master' into ilm/data-tiers-for-710
elasticmachine fcb2eaa
slight UX update to turning on custom attribute allocation
jloleysens 806c4e3
added scss file for data tier advanced section and other style
jloleysens ecea8fc
added tests for new warning
jloleysens 4e3bf56
Merge branch 'master' into ilm/data-tiers-for-710
elasticmachine 8b1f1dd
Merge branch 'master' of github.com:elastic/kibana into ilm/data-tier…
jloleysens 9ff986d
fix types
jloleysens 1a75f5f
added correct copy for cold and frozen phases
jloleysens a608425
Merge branch 'master' into ilm/data-tiers-for-710
elasticmachine a9cd4f7
fix types and i18n
jloleysens ac58f77
implement copy feedback
jloleysens 021da15
added spacer after the enable data tier allocation switch
jloleysens 567ce64
refactor to super select
jloleysens 4170364
fix replicas copy
jloleysens 06ebb97
update phase serialization for cold and frozen
jloleysens d7d5313
Refactor so that logic determining warnings lives together
jloleysens 41ae883
tier -> phase
jloleysens d782706
Added some much needed policy serialization test coverage
jloleysens a3fbe8d
fix import paths and added required file header
jloleysens baacace
fix existing test coverage
jloleysens 28145f2
refine copy for data tier allocation recommended option
jloleysens 02509e1
fix showing warning for no node attrs
jloleysens 50d99be
Merge branch 'master' of github.com:elastic/kibana into ilm/data-tier…
jloleysens dbbd4c9
fix inverted warning logic 🤦🏼♂️
jloleysens 96b1209
fix typing
jloleysens d91a960
implement CJs copy feedback
jloleysens 835333b
fix i18n
jloleysens 4acba5f
remove unused or invalid translations
jloleysens c0b8c1e
provide ability to not alter original policy
jloleysens 83ac6b9
do not alter the original policy in the serilalization process
jloleysens 4146ba2
Merge branch 'master' of github.com:elastic/kibana into ilm/data-tier…
jloleysens 8d0d46b
fix jest tests
jloleysens d695e95
Remove duplicate type and refactor NodeRole to NodeDataRole
jloleysens 36e4a45
added comment to "false" typing
jloleysens 50a9651
revised and refactored copy based on feedback
jloleysens 8a69d28
address copy feedback
jloleysens 14fbf8c
update kibana schema to allow migrate: { enabled: false }
jloleysens e604dd6
Merge branch 'master' into ilm/data-tiers-for-710
elasticmachine 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
203 changes: 180 additions & 23 deletions
203
x-pack/plugins/index_lifecycle_management/__jest__/components/edit_policy.test.tsx
Large diffs are not rendered by default.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
x-pack/plugins/index_lifecycle_management/__jest__/components/helpers/edit_policy.ts
This file contains 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,30 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { init as initHttpRequests } from './http_requests'; | ||
|
||
export type EditPolicySetup = ReturnType<typeof setup>; | ||
|
||
export const setup = () => { | ||
const { httpRequestsMockHelpers, server } = initHttpRequests(); | ||
|
||
const setupNodeListResponse = ( | ||
response: Record<string, any> = { | ||
nodesByAttributes: { 'attribute:true': ['node1'] }, | ||
nodesByRoles: { data: ['node1'] }, | ||
} | ||
) => { | ||
httpRequestsMockHelpers.setNodesListResponse(response); | ||
}; | ||
|
||
return { | ||
http: { | ||
setupNodeListResponse, | ||
httpRequestsMockHelpers, | ||
server, | ||
}, | ||
}; | ||
}; |
This file contains 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
11 changes: 11 additions & 0 deletions
11
x-pack/plugins/index_lifecycle_management/__jest__/components/helpers/index.ts
This file contains 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,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import * as editPolicyHelpers from './edit_policy'; | ||
|
||
export { HttpRequestMockHelpers, init } from './http_requests'; | ||
|
||
export { editPolicyHelpers }; |
12 changes: 12 additions & 0 deletions
12
x-pack/plugins/index_lifecycle_management/common/types/api.ts
This file contains 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,12 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export type NodeDataRole = 'data' | 'data_hot' | 'data_warm' | 'data_cold' | 'data_frozen'; | ||
|
||
export interface ListNodesRouteResponse { | ||
nodesByAttributes: { [attributePair: string]: string[] }; | ||
nodesByRoles: { [role in NodeDataRole]?: string[] }; | ||
} |
This file contains 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 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 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
36 changes: 36 additions & 0 deletions
36
...index_lifecycle_management/public/application/lib/data_tiers/check_phase_compatibility.ts
This file contains 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,36 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { | ||
NodeDataRole, | ||
ListNodesRouteResponse, | ||
PhaseWithAllocation, | ||
} from '../../../../common/types'; | ||
|
||
/** | ||
* Given a phase and current node roles, determine whether the phase | ||
* can use default data tier allocation. | ||
* | ||
* This can only be checked for phases that have an allocate action. | ||
*/ | ||
export const isPhaseDefaultDataAllocationCompatible = ( | ||
phase: PhaseWithAllocation, | ||
nodesByRoles: ListNodesRouteResponse['nodesByRoles'] | ||
): boolean => { | ||
// The 'data' role covers all node roles, so if we have at least one node with the data role | ||
// we can use default allocation. | ||
if (nodesByRoles.data?.length) { | ||
return true; | ||
} | ||
|
||
// Otherwise we need to check whether a node role for the specific phase exists | ||
if (nodesByRoles[`data_${phase}` as NodeDataRole]?.length) { | ||
return true; | ||
} | ||
|
||
// Otherwise default allocation has nowhere to allocate new shards to in this phase. | ||
return false; | ||
}; |
34 changes: 34 additions & 0 deletions
34
...index_lifecycle_management/public/application/lib/data_tiers/determine_allocation_type.ts
This file contains 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,34 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { DataTierAllocationType, AllocateAction } from '../../../../common/types'; | ||
|
||
/** | ||
* Determine what deserialized state the policy config represents. | ||
* | ||
* See {@DataTierAllocationType} for more information. | ||
*/ | ||
export const determineDataTierAllocationType = ( | ||
allocateAction?: AllocateAction | ||
): DataTierAllocationType => { | ||
if (!allocateAction) { | ||
return 'default'; | ||
} | ||
|
||
if (allocateAction.migrate?.enabled === false) { | ||
return 'none'; | ||
} | ||
|
||
if ( | ||
(allocateAction.require && Object.keys(allocateAction.require).length) || | ||
(allocateAction.include && Object.keys(allocateAction.include).length) || | ||
(allocateAction.exclude && Object.keys(allocateAction.exclude).length) | ||
) { | ||
return 'custom'; | ||
} | ||
|
||
return 'default'; | ||
}; |
9 changes: 9 additions & 0 deletions
9
x-pack/plugins/index_lifecycle_management/public/application/lib/data_tiers/index.ts
This file contains 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,9 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export * from './determine_allocation_type'; | ||
|
||
export * from './check_phase_compatibility'; |
7 changes: 7 additions & 0 deletions
7
x-pack/plugins/index_lifecycle_management/public/application/lib/index.ts
This file contains 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,7 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export * from './data_tiers'; |
9 changes: 9 additions & 0 deletions
9
...pplication/sections/edit_policy/components/data_tier_allocation/data_tier_allocation.scss
This file contains 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,9 @@ | ||
.indexLifecycleManagement__phase__dataTierAllocation { | ||
&__controlSection { | ||
background-color: $euiColorLightestShade; | ||
padding-top: $euiSizeM; | ||
padding-left: $euiSizeM; | ||
padding-right: $euiSizeM; | ||
padding-bottom: $euiSizeM; | ||
} | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was setting
false
here intentional?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it was, :). The default will be for enabled to be true so the only reason to ever specify this at the moment is to turn migration off. I will add a comment to that effect 👍