Skip to content

Commit

Permalink
Merge branch 'master' into rebuild_nested_fields_structure
Browse files Browse the repository at this point in the history
 Conflicts:
	x-pack/plugins/security_solution/server/search_strategy/timeline/factory/events/all/helpers.test.ts
  • Loading branch information
rylnd committed Apr 12, 2021
2 parents bbbe168 + 8bf9e86 commit f60a165
Show file tree
Hide file tree
Showing 179 changed files with 5,370 additions and 2,979 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-embeddable-server](./kibana-plugin-plugins-embeddable-server.md) &gt; [EmbeddableStart](./kibana-plugin-plugins-embeddable-server.embeddablestart.md)

## EmbeddableStart type

<b>Signature:</b>

```typescript
export declare type EmbeddableStart = PersistableStateService<EmbeddableStateWithType>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@
| --- | --- |
| [plugin](./kibana-plugin-plugins-embeddable-server.plugin.md) | |

## Type Aliases

| Type Alias | Description |
| --- | --- |
| [EmbeddableStart](./kibana-plugin-plugins-embeddable-server.embeddablestart.md) | |

5 changes: 5 additions & 0 deletions docs/management/index-patterns.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ pattern:
*:logstash-*
```

You can use exclusions to exclude indices that might contain mapping errors.
To match indices starting with `logstash-`, and exclude those starting with `logstash-old` from
all clusters having a name starting with `cluster_`, you can use `cluster_*:logstash-*,cluster*:logstash-old*`.
To exclude a cluster, use `cluster_*:logstash-*,cluster_one:-*`.

Once an index pattern is configured using the {ccs} syntax, all searches and
aggregations using that index pattern in {kib} take advantage of {ccs}.

Expand Down
11 changes: 11 additions & 0 deletions docs/settings/dev-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,14 @@ They are enabled by default.
| Set to `true` to enable the <<xpack-profiler,{searchprofiler}>>. Defaults to `true`.

|===

[float]
[[painless_lab-settings]]
==== Painless Lab settings

[cols="2*<"]
|===
| `xpack.painless_lab.enabled`
| When set to `true`, enables the <<painlesslab, Painless Lab>>. Defaults to `true`.

|===
4 changes: 3 additions & 1 deletion examples/dashboard_embeddable_examples/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ const Nav = withRouter(({ history, pages }: NavProps) => {

interface Props {
basename: string;
DashboardContainerByValueRenderer: DashboardStart['DashboardContainerByValueRenderer'];
DashboardContainerByValueRenderer: ReturnType<
DashboardStart['getDashboardContainerByValueRenderer']
>;
}

const DashboardEmbeddableExplorerApp = ({ basename, DashboardContainerByValueRenderer }: Props) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ const initialInput: DashboardContainerInput = {
export const DashboardEmbeddableByValue = ({
DashboardContainerByValueRenderer,
}: {
DashboardContainerByValueRenderer: DashboardStart['DashboardContainerByValueRenderer'];
DashboardContainerByValueRenderer: ReturnType<
DashboardStart['getDashboardContainerByValueRenderer']
>;
}) => {
const [input, setInput] = useState(initialInput);

Expand Down
3 changes: 1 addition & 2 deletions examples/dashboard_embeddable_examples/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ export class DashboardEmbeddableExamples implements Plugin<void, void, {}, Start
return renderApp(
{
basename: params.appBasePath,
DashboardContainerByValueRenderer:
depsStart.dashboard.DashboardContainerByValueRenderer,
DashboardContainerByValueRenderer: depsStart.dashboard.getDashboardContainerByValueRenderer(),
},
params.element
);
Expand Down
Binary file added rfcs/images/ols_phase_1_auth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
323 changes: 323 additions & 0 deletions rfcs/text/0016_ols_phase_1.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,18 @@ describe('ElasticIndex', () => {
size: 100,
query: {
bool: {
must_not: {
term: {
type: 'fleet-agent-events',
must_not: [
{
term: {
type: 'fleet-agent-events',
},
},
},
{
term: {
type: 'tsvb-validation-telemetry',
},
},
],
},
},
},
Expand Down
23 changes: 13 additions & 10 deletions src/core/server/saved_objects/migrations/core/elastic_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,19 @@ export function reader(
let scrollId: string | undefined;

// When migrating from the outdated index we use a read query which excludes
// saved objects which are no longer used. These saved objects will still be
// kept in the outdated index for backup purposes, but won't be availble in
// the upgraded index.
const excludeUnusedTypes = {
// saved object types which are no longer used. These saved objects will
// still be kept in the outdated index for backup purposes, but won't be
// availble in the upgraded index.
const EXCLUDE_UNUSED_TYPES = [
'fleet-agent-events', // https://github.com/elastic/kibana/issues/91869
'tsvb-validation-telemetry', // https://github.com/elastic/kibana/issues/95617
];

const excludeUnusedTypesQuery = {
bool: {
must_not: {
term: {
type: 'fleet-agent-events', // https://github.com/elastic/kibana/issues/91869
},
},
must_not: EXCLUDE_UNUSED_TYPES.map((type) => ({
term: { type },
})),
},
};

Expand All @@ -92,7 +95,7 @@ export function reader(
: client.search<SearchResponse<SavedObjectsRawDocSource>>({
body: {
size: batchSize,
query: excludeUnusedTypes,
query: excludeUnusedTypesQuery,
},
index,
scroll,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ describe('KibanaMigrator', () => {
options.client.tasks.get.mockReturnValue(
elasticsearchClientMock.createSuccessTransportRequestPromise({
completed: true,
error: { type: 'elatsicsearch_exception', reason: 'task failed with an error' },
error: { type: 'elasticsearch_exception', reason: 'task failed with an error' },
failures: [],
task: { description: 'task description' } as any,
})
Expand All @@ -331,11 +331,11 @@ describe('KibanaMigrator', () => {
migrator.prepareMigrations();
await expect(migrator.runMigrations()).rejects.toMatchInlineSnapshot(`
[Error: Unable to complete saved object migrations for the [.my-index] index. Error: Reindex failed with the following error:
{"_tag":"Some","value":{"type":"elatsicsearch_exception","reason":"task failed with an error"}}]
{"_tag":"Some","value":{"type":"elasticsearch_exception","reason":"task failed with an error"}}]
`);
expect(loggingSystemMock.collect(options.logger).error[0][0]).toMatchInlineSnapshot(`
[Error: Reindex failed with the following error:
{"_tag":"Some","value":{"type":"elatsicsearch_exception","reason":"task failed with an error"}}]
{"_tag":"Some","value":{"type":"elasticsearch_exception","reason":"task failed with an error"}}]
`);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ describe('actions', () => {
'my_source_index',
'my_target_index',
Option.none,
false
false,
Option.none
);
try {
await task();
Expand Down
21 changes: 18 additions & 3 deletions src/core/server/saved_objects/migrationsv2/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { errors as EsErrors } from '@elastic/elasticsearch';
import type { ElasticsearchClientError, ResponseError } from '@elastic/elasticsearch/lib/errors';
import { pipe } from 'fp-ts/lib/pipeable';
import { flow } from 'fp-ts/lib/function';
import { QueryContainer } from '@elastic/eui/src/components/search_bar/query/ast_to_es_query_dsl';
import { ElasticsearchClient } from '../../../elasticsearch';
import { IndexMapping } from '../../mappings';
import { SavedObjectsRawDoc, SavedObjectsRawDocSource } from '../../serialization';
Expand Down Expand Up @@ -184,10 +185,10 @@ export const removeWriteBlock = (
* yellow at any point in the future. So ultimately data-redundancy is up to
* users to maintain.
*/
const waitForIndexStatusYellow = (
export const waitForIndexStatusYellow = (
client: ElasticsearchClient,
index: string,
timeout: string
timeout = DEFAULT_TIMEOUT
): TaskEither.TaskEither<RetryableEsClientError, {}> => () => {
return client.cluster
.health({ index, wait_for_status: 'yellow', timeout })
Expand Down Expand Up @@ -436,7 +437,12 @@ export const reindex = (
sourceIndex: string,
targetIndex: string,
reindexScript: Option.Option<string>,
requireAlias: boolean
requireAlias: boolean,
/* When reindexing we use a source query to exclude saved objects types which
* are no longer used. These saved objects will still be kept in the outdated
* index for backup purposes, but won't be availble in the upgraded index.
*/
unusedTypesToExclude: Option.Option<string[]>
): TaskEither.TaskEither<RetryableEsClientError, ReindexResponse> => () => {
return client
.reindex({
Expand All @@ -450,6 +456,15 @@ export const reindex = (
index: sourceIndex,
// Set reindex batch size
size: BATCH_SIZE,
// Exclude saved object types
query: Option.fold<string[], QueryContainer | undefined>(
() => undefined,
(types) => ({
bool: {
must_not: types.map((type) => ({ term: { type } })),
},
})
)(unusedTypesToExclude),
},
dest: {
index: targetIndex,
Expand Down
Loading

0 comments on commit f60a165

Please sign in to comment.