Skip to content

Merge feature/searchable-snapshots branch into master #54803

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 103 commits into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
186d813
Add Searchable Snapshots plugin project (#50022)
tlrx Dec 10, 2019
61e6029
Merge branch 'master' into feature/searchable-snapshots
tlrx Dec 11, 2019
b5ae5ba
Merge branch 'master' into feature/searchable-snapshots
tlrx Dec 13, 2019
0940bcd
Add Lucene directory and index input implementations that expose shar…
tlrx Dec 13, 2019
287019a
Merge branch 'master' into feature/searchable-snapshots
tlrx Dec 16, 2019
74c4041
Add SearchableSnapshotRepository (#50239)
DaveCTurner Dec 17, 2019
8cfa8b6
Merge branch 'master' into feature/searchable-snapshots
tlrx Dec 18, 2019
00b7647
Merge branch 'master' into feature/searchable-snapshots
tlrx Jan 2, 2020
f6adcc6
Merge branch 'master' into feature/searchable-snapshots
tlrx Jan 6, 2020
f613ad7
Merge branch 'master' into feature/searchable-snapshots
DaveCTurner Jan 9, 2020
f3649c4
Merge branch 'master' into feature/searchable-snapshots
DaveCTurner Jan 15, 2020
aea62f5
Fix corruption simulation in RecoveryFromGatewayIT (#50921)
DaveCTurner Jan 15, 2020
115997b
Merge branch 'master' into feature/searchable-snapshots
DaveCTurner Jan 15, 2020
cd72774
Test concurrent cloning/slicing of IndexInputs (#51032)
DaveCTurner Jan 16, 2020
4ff6c79
Merge branch 'master' into feature/searchable-snapshots
tlrx Jan 20, 2020
e419d91
Add ranged readBlob to S3BlobContainer (#51137)
ywelsch Jan 21, 2020
85af782
Merge branch 'master' into feature/searchable-snapshots
tlrx Jan 22, 2020
ec4b5bf
Merge branch 'master' into feature/searchable-snapshots
DaveCTurner Jan 23, 2020
ffc5a82
Wait for concurrent reads in ESIndexInputTestCase (#51425)
DaveCTurner Jan 24, 2020
714c480
Add searchable snapshots cache directory (#50693)
tlrx Jan 27, 2020
f2a4957
Remove file field from CacheFileReference (#51520)
DaveCTurner Jan 28, 2020
4c686c1
Add Cache Range Size setting (#51521)
tlrx Jan 28, 2020
b88a798
Fix SearchableSnapshotDirectoryTests.testDirectoryReader (#51343)
tlrx Jan 28, 2020
101c419
Use dedicated cache keys instead of relying on an absolute path (#51669)
tlrx Jan 31, 2020
e23974b
Merge branch 'master' into feature/searchable-snapshots
tlrx Jan 31, 2020
ef18352
Fix compilation issues after merging master
tlrx Jan 31, 2020
229b953
Add cache directory low-level instrumentation (#51637)
tlrx Jan 31, 2020
f1b0991
Merge branch 'master' into feature/searchable-snapshots
DaveCTurner Feb 3, 2020
30b5553
Optimize sequential reads in SearchableSnapshotIndexInput (#51230)
DaveCTurner Feb 4, 2020
a990dd7
Merge branch 'master' into feature/searchable-snapshots
tlrx Feb 4, 2020
85ec740
Merge branch 'master' into feature/searchable-snapshots
tlrx Feb 6, 2020
c73cf68
Add REST API for cache directory stats (#51815)
tlrx Feb 6, 2020
524fb76
Merge branch 'master' into feature/searchable-snapshots
tlrx Feb 11, 2020
48f29ad
Merge branch 'master' into feature/searchable-snapshots
tlrx Feb 12, 2020
c97c97c
Adapt searchable snapshots code to latest master changes (#52258)
tlrx Feb 12, 2020
957a7ae
SearchableSnapshotIndexInput should read all bytes (#52199)
tlrx Feb 12, 2020
5b115fb
Add S3 integration tests for searchable snapshots (#52263)
tlrx Feb 18, 2020
097edf4
Merge branch 'master' into feature/searchable-snapshots
DaveCTurner Feb 19, 2020
d6220c5
Fix up merge
DaveCTurner Feb 19, 2020
799eaa7
Merge branch 'master' into feature/searchable-snapshots
tlrx Feb 21, 2020
e620d57
Adapt Searchable Snapshots to latest master changes
tlrx Feb 21, 2020
c9ac57f
Add stats for time spent fetching data while searching snapshots (#51…
DaveCTurner Feb 24, 2020
c049b02
Fix searchable snapshot stats fwd/bwd seeking counters (#52760)
tlrx Feb 25, 2020
f1f598e
Exclude indices with cache disabled from searchable snapshots stats (…
tlrx Feb 26, 2020
308adaa
Account for soft-deletes (#52781)
tlrx Feb 26, 2020
054111d
Merge branch 'master' into feature/searchable-snapshots
tlrx Feb 26, 2020
25b17ae
Adapt searchable snapshot to latest master changes
tlrx Feb 26, 2020
ac08315
Fix REST tests after master merge
tlrx Feb 27, 2020
10e830a
Merge branch 'master' into feature/searchable-snapshots
DaveCTurner Mar 2, 2020
050583e
Allow freezing searchable snapshots (#52653)
DaveCTurner Mar 2, 2020
7f8cd95
Merge branch 'master' into feature/searchable-snapshots
tlrx Mar 3, 2020
d713b9e
Add Clear Cache API for Searchable Snapshots (#53009)
tlrx Mar 3, 2020
1961cc0
Merge branch 'master' into feature/searchable-snapshots
DaveCTurner Mar 6, 2020
dbe6164
Merge branch 'master' into feature/searchable-snapshots
DaveCTurner Mar 6, 2020
f92d765
Merge branch 'master' into feature/searchable-snapshots
DaveCTurner Mar 9, 2020
a4343a8
Merge branch 'master' into feature/searchable-snapshots
DaveCTurner Mar 9, 2020
88b01a2
Add API to mount a snapshot as a searchable index (#53084)
dakrone Mar 10, 2020
71237a1
Merge branch 'master' into feature/searchable-snapshots
DaveCTurner Mar 11, 2020
95b1acc
Move MountSearchableActionRequest and Action to xpack/core (#53394)
andreidan Mar 11, 2020
215e94d
Auto-allocate searchable snapshots (#52527)
DaveCTurner Mar 11, 2020
906c8a2
Merge branch 'master' into feature/searchable-snapshots
andreidan Mar 12, 2020
4bde03a
Associate translog with Lucene index commit for searchable snapshots …
tlrx Mar 13, 2020
d35c156
Merge branch 'master' into feature/searchable-snapshots
DaveCTurner Mar 16, 2020
037a9be
Revert workarounds for tryOpenIndex change (#53615)
DaveCTurner Mar 16, 2020
b7c4c31
Merge branch 'master' into feature/searchable-snapshots
tlrx Mar 20, 2020
8c732d0
Uncouple CacheDirectory from SearchableSnapshotDirectory (#53860)
tlrx Mar 20, 2020
815c861
Extract CacheBufferedIndexInput from CacheDirectory (#53879)
tlrx Mar 20, 2020
02aa32e
Fold CacheDirectory within SearchableSnapshotDirectory (#53917)
tlrx Mar 24, 2020
673212b
Merge branch 'master' into feature/searchable-snapshots
tlrx Mar 24, 2020
4e4a705
Fix test after merge
tlrx Mar 24, 2020
47ec08d
CacheBufferedIndexInput should throw EOFException (#53975)
DaveCTurner Mar 25, 2020
897e477
Fix up merge
DaveCTurner Mar 25, 2020
0b9cc85
Merge branch 'master' into feature/searchable-snapshots
DaveCTurner Mar 25, 2020
d9b8249
Merge branch 'master' into feature/searchable-snapshots
tlrx Mar 26, 2020
2b67f16
Fix off by one error in test
tlrx Mar 26, 2020
d903877
Merge branch 'master' into feature/searchable-snapshots
andreidan Mar 27, 2020
614843a
Exclue searchable-snapshots from Spotless
andreidan Mar 27, 2020
8f41e61
Exclue searchable-snapshots:qa from Spotless
andreidan Mar 27, 2020
e669f14
Add file type-based exclusion setting for searchable snapshots cache …
ywelsch Mar 27, 2020
e20f16e
Better skip bytes in FsBlobContainer (#54333)
tlrx Mar 27, 2020
f82f104
Extract files stored within metadata hash into ByteArrayIndexInputs (…
tlrx Mar 27, 2020
4db29c0
Rename SearchableSnapshotIndexInput and move cache classes into store…
tlrx Mar 27, 2020
e43f8b2
Merge branch 'master' into feature/searchable-snapshots
tlrx Mar 30, 2020
ff0eda5
Merge branch 'master' into feature/searchable-snapshots
DaveCTurner Mar 31, 2020
f8edeee
Introduce feature flag for searchable snapshots (#54424)
DaveCTurner Mar 31, 2020
773e7e3
Defer repo ops in searchable snapshot restore (#54211)
DaveCTurner Mar 31, 2020
a5c7bec
ILM: add searchable snapshot action (#52585)
andreidan Apr 1, 2020
f879268
Add Azure support for ranged read blob operations (#54358)
tlrx Apr 1, 2020
c6e3185
Add optimized / direct read stats for non-cached files (#54439)
tlrx Apr 1, 2020
966b363
ILM don't fail the mount step on ACCEPTED response (#54580)
andreidan Apr 1, 2020
3a6203f
Merge branch 'master' into feature/searchable-snapshots
andreidan Apr 2, 2020
19772b6
Fix merge errors
andreidan Apr 2, 2020
e8cf4f9
Add basic documentation for Searchable Snapshots REST APIs (#54581)
tlrx Apr 2, 2020
6e7a5e0
Fix small reads of multi-part blobs (#54573)
DaveCTurner Apr 2, 2020
0a4b26c
Apply Spotless formatting (#54644)
tlrx Apr 2, 2020
64a2813
Merge branch 'master' into feature/searchable-snapshots
andreidan Apr 3, 2020
4ef4204
ILM wait for snapshot creation to complete (#54673)
andreidan Apr 3, 2020
34d3478
ILM MountSnapshotStep: use correct logic operator (#54675)
andreidan Apr 3, 2020
66f4433
ILM Initial documentation for searchable snapshots (#54727)
andreidan Apr 5, 2020
65e57e6
Merge branch 'master' into feature/searchable-snapshots
tlrx Apr 6, 2020
676d441
Require license for searchable snapshots (#54730)
DaveCTurner Apr 6, 2020
104ba40
Trigger explicit loading of blob container and snapshot in the pre-re…
tlrx Apr 6, 2020
3455e0c
Handle shard closed during prerecovery (#54790)
DaveCTurner Apr 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,21 @@ private static class NoopGatewayAllocator extends GatewayAllocator {
public static final NoopGatewayAllocator INSTANCE = new NoopGatewayAllocator();

@Override
public void applyStartedShards(RoutingAllocation allocation, List<ShardRouting> startedShards) {
public void applyStartedShards(List<ShardRouting> startedShards, RoutingAllocation allocation) {
// noop
}

@Override
public void applyFailedShards(RoutingAllocation allocation, List<FailedShard> failedShards) {
public void applyFailedShards(List<FailedShard> failedShards, RoutingAllocation allocation) {
// noop
}

@Override
public void allocateUnassigned(RoutingAllocation allocation) {
public void allocateUnassigned(
ShardRouting shardRouting,
RoutingAllocation allocation,
UnassignedAllocationHandler unassignedAllocationHandler
) {
// noop
}
}
Expand Down
1 change: 1 addition & 0 deletions docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ testClusters.integTest {
if (BuildParams.isSnapshotBuild() == false) {
systemProperty 'es.autoscaling_feature_flag_registered', 'true'
systemProperty 'es.eql_feature_flag_registered', 'true'
systemProperty 'es.searchable_snapshots_feature_enabled', 'true'
}
setting 'xpack.autoscaling.enabled', 'true'
setting 'xpack.eql.enabled', 'true'
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/ilm/apis/get-lifecycle.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ If the request succeeds, the body of the response contains the policy definition
"delete": {
"min_age": "30d",
"actions": {
"delete": {}
"delete": {
"delete_searchable_snapshot": true
}
}
}
}
Expand Down
48 changes: 47 additions & 1 deletion docs/reference/ilm/policy-definitions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ policy definition.
- <<ilm-unfollow-action,Unfollow>>
- <<ilm-allocate-action,Allocate>>
- <<ilm-freeze-action,Freeze>>
- <<ilm-searchable-snapshot-action, Searchable Snapshot>>
* Delete
- <<ilm-wait-for-snapshot-action,Wait For Snapshot>>
- <<ilm-delete-action,Delete>>
Expand Down Expand Up @@ -271,7 +272,15 @@ Phases allowed: delete.

The Delete Action does just that, it deletes the index.

This action does not have any options associated with it.
[[ilm-delete-action-options]]
.Delete
[options="header"]
|======
| Name | Required | Default | Description
| `delete_searchable_snapshot` | no | true | Deletes the searchable snapshot created in the cold phase, if a
snapshot was created (ie. if the <<ilm-searchable-snapshot-action,
Searchable Snapshot Action>> was used in the cold phase)
|======

[source,console]
--------------------------------------------------
Expand Down Expand Up @@ -585,6 +594,43 @@ The above example illustrates a policy which attempts to delete an
index one day after the index has been rolled over. It does not
delete the index one day after it has been created.

[[ilm-searchable-snapshot-action]]
==== Searchable Snapshot

Phases allowed: cold.

This action takes a snapshot of the managed index in the configured repository
and mounts it as a searchable snapshot.

[[ilm-searchable-snapshot-options]]
.Searchable Snapshot Options
[options="header"]
|======
| Name | Required | Default | Description
| `snapshot_repository` | yes | - | Repository used to store the snapshot created by this action. The snapshot will be,
by default, deleted by the <<ilm-delete-action, Delete Action>> in the delete phase, if
configured, but the user can configure the <<ilm-delete-action, Delete Action>> to keep
the snapshot using the `delete_searchable_snapshot` option.

|======

[source,console]
--------------------------------------------------
PUT _ilm/policy/my_policy
{
"policy": {
"phases": {
"cold": {
"actions": {
"searchable_snapshot" : {
"snapshot_repository" : "backing_repo"
}
}
}
}
}
}
--------------------------------------------------
[[ilm-set-priority-action]]
==== Set Priority

Expand Down
4 changes: 3 additions & 1 deletion docs/reference/ilm/update-lifecycle-policy.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ with its version bumped to 2.
"delete": {
"min_age": "10d",
"actions": {
"delete": {}
"delete": {
"delete_searchable_snapshot": true
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/rest-api/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ endif::[]
* <<indices-reload-analyzers,Reload Search Analyzers API>>
* <<rollup-apis,Rollup APIs>>
* <<search, Search APIs>>
* <<searchable-snapshots-apis, Searchable snapshots APIs>>
* <<security-api,Security APIs>>
* <<snapshot-lifecycle-management-api,Snapshot lifecycle management APIs>>
* <<transform-apis,{transform-cap} APIs>>
Expand Down Expand Up @@ -59,6 +60,7 @@ include::{es-repo-dir}/migration/migration.asciidoc[]
include::{es-repo-dir}/indices/apis/reload-analyzers.asciidoc[]
include::{es-repo-dir}/rollup/rollup-api.asciidoc[]
include::{es-repo-dir}/search.asciidoc[]
include::{es-repo-dir}/searchable-snapshots/apis/searchable-snapshots-apis.asciidoc[]
include::{xes-repo-dir}/rest-api/security.asciidoc[]
include::{es-repo-dir}/slm/apis/slm-api.asciidoc[]
include::{es-repo-dir}/transform/apis/index.asciidoc[]
Expand Down
76 changes: 76 additions & 0 deletions docs/reference/searchable-snapshots/apis/clear-cache.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
[role="xpack"]
[testenv="basic"]
[[searchable-snapshots-api-clear-cache]]
=== Clear cache API
++++
<titleabbrev>Clear cache</titleabbrev>
++++

experimental[]

Clear the cache of searchable snapshots.

[[searchable-snapshots-api-clear-cache-request]]
==== {api-request-title}

`POST /_searchable_snapshots/cache/clear`

`POST /<index>/_searchable_snapshots/cache/clear`

[[searchable-snapshots-api-clear-cache-prereqs]]
==== {api-prereq-title}

If the {es} {security-features} are enabled, you must have the
`manage` cluster privilege and the `manage` index privilege
for any included indices to use this API.
For more information, see <<security-privileges>>.

[[searchable-snapshots-api-clear-cache-desc]]
==== {api-description-title}


[[searchable-snapshots-api-clear-cache-path-params]]
==== {api-path-parms-title}

`<index>`::
(Optional, string)
A comma-separated list of index names for which the
searchable snapshots cache must be cleared.


[[searchable-snapshots-api-clear-cache-example]]
==== {api-examples-title}
////
[source,console]
-----------------------------------
PUT /docs
{
"settings" : {
"index.number_of_shards" : 1,
"index.number_of_replicas" : 0
}
}
PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true
{
"include_global_state": false,
"indices": "docs"
}
DELETE /docs
POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true
{
"index": "docs"
}
-----------------------------------
// TEST[setup:setup-repository]
////

Clears the cache of the index `docs`:

[source,console]
--------------------------------------------------
POST /docs/_searchable_snapshots/cache/clear
--------------------------------------------------
// TEST[continued]
76 changes: 76 additions & 0 deletions docs/reference/searchable-snapshots/apis/get-stats.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
[role="xpack"]
[testenv="basic"]
[[searchable-snapshots-api-stats]]
=== Searchable snapshot statistics API
++++
<titleabbrev>Searchable snapshot statistics</titleabbrev>
++++

experimental[]

Retrieve various statistics about searchable snapshots.

[[searchable-snapshots-api-stats-request]]
==== {api-request-title}

`GET /_searchable_snapshots/stats`

`GET /<index>/_searchable_snapshots/stats`

[[searchable-snapshots-api-stats-prereqs]]
==== {api-prereq-title}

If the {es} {security-features} are enabled, you must have the
`manage` cluster privilege and the `manage` index privilege
for any included indices to use this API.
For more information, see <<security-privileges>>.

[[searchable-snapshots-api-stats-desc]]
==== {api-description-title}


[[searchable-snapshots-api-stats-path-params]]
==== {api-path-parms-title}

`<index>`::
(Optional, string)
A comma-separated list of index names for which the
statistics must be retrieved.


[[searchable-snapshots-api-stats-example]]
==== {api-examples-title}
////
[source,console]
-----------------------------------
PUT /docs
{
"settings" : {
"index.number_of_shards" : 1,
"index.number_of_replicas" : 0
}
}

PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true
{
"include_global_state": false,
"indices": "docs"
}

DELETE /docs

POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true
{
"index": "docs"
}
-----------------------------------
// TEST[setup:setup-repository]
////

Retrieves the statistics of the index `docs`:

[source,console]
--------------------------------------------------
GET /docs/_searchable_snapshots/stats
--------------------------------------------------
// TEST[continued]
Loading