-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix illegal access on PIT creation for frozen index (#73517)
Closes #73514
- Loading branch information
1 parent
f454cef
commit 48de999
Showing
4 changed files
with
162 additions
and
3 deletions.
There are no files selected for viewing
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
155 changes: 155 additions & 0 deletions
155
...plugin/searchable-snapshots/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/pit.yml
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,155 @@ | ||
--- | ||
setup: | ||
|
||
- do: | ||
indices.create: | ||
index: docs | ||
body: | ||
settings: | ||
number_of_shards: 1 | ||
number_of_replicas: 0 | ||
|
||
- do: | ||
bulk: | ||
body: | ||
- index: | ||
_index: docs | ||
_id: 1 | ||
- field: foo | ||
- index: | ||
_index: docs | ||
_id: 2 | ||
- field: bar | ||
- index: | ||
_index: docs | ||
_id: 3 | ||
- field: baz | ||
|
||
- do: | ||
snapshot.create_repository: | ||
repository: repository-fs | ||
body: | ||
type: fs | ||
settings: | ||
location: "repository-fs" | ||
|
||
# Remove the snapshot if a previous test failed to delete it. | ||
# Useful for third party tests that runs the test against a real external service. | ||
- do: | ||
snapshot.delete: | ||
repository: repository-fs | ||
snapshot: snapshot | ||
ignore: 404 | ||
|
||
- do: | ||
snapshot.create: | ||
repository: repository-fs | ||
snapshot: snapshot | ||
wait_for_completion: true | ||
|
||
- do: | ||
indices.delete: | ||
index: docs | ||
--- | ||
teardown: | ||
|
||
- do: | ||
snapshot.delete: | ||
repository: repository-fs | ||
snapshot: snapshot | ||
ignore: 404 | ||
|
||
- do: | ||
snapshot.delete_repository: | ||
repository: repository-fs | ||
|
||
--- | ||
"Tests searches vs default-storage index": | ||
- do: | ||
searchable_snapshots.mount: | ||
repository: repository-fs | ||
snapshot: snapshot | ||
wait_for_completion: true | ||
body: | ||
index: docs | ||
renamed_index: docs-default-storage | ||
|
||
- match: { snapshot.snapshot: snapshot } | ||
- match: { snapshot.shards.failed: 0 } | ||
- match: { snapshot.shards.successful: 1 } | ||
|
||
- do: | ||
search: | ||
index: docs-default-storage | ||
body: | ||
query: | ||
match_all: {} | ||
|
||
- match: { hits.total.value: 3 } | ||
|
||
- do: | ||
open_point_in_time: | ||
index: docs-default-storage | ||
keep_alive: 5m | ||
- set: {id: point_in_time_id} | ||
|
||
- do: | ||
search: | ||
body: | ||
pit: | ||
id: "$point_in_time_id" | ||
keep_alive: 1m | ||
|
||
- match: { hits.total.value: 3 } | ||
|
||
- do: | ||
close_point_in_time: | ||
body: | ||
id: "$point_in_time_id" | ||
|
||
|
||
--- | ||
"Tests searches vs shared-cache index": | ||
- do: | ||
searchable_snapshots.mount: | ||
repository: repository-fs | ||
snapshot: snapshot | ||
wait_for_completion: true | ||
storage: shared_cache | ||
body: | ||
index: docs | ||
renamed_index: docs-shared-cache | ||
|
||
- match: { snapshot.snapshot: snapshot } | ||
- match: { snapshot.shards.failed: 0 } | ||
- match: { snapshot.shards.successful: 1 } | ||
|
||
- do: | ||
search: | ||
index: docs-shared-cache | ||
body: | ||
query: | ||
match_all: {} | ||
|
||
- match: { hits.total.value: 3 } | ||
|
||
- do: | ||
open_point_in_time: | ||
index: docs-shared-cache | ||
keep_alive: 5m | ||
- set: {id: point_in_time_id} | ||
|
||
- do: | ||
search: | ||
body: | ||
pit: | ||
id: "$point_in_time_id" | ||
keep_alive: 1m | ||
|
||
- match: { hits.total.value: 3 } | ||
|
||
- do: | ||
close_point_in_time: | ||
body: | ||
id: "$point_in_time_id" | ||
|