-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.8] Fix NPE when indexing a document that just has been deleted in …
…a tsdb index (#96476) Backporting #96461 to 8.8 branch. Sometimes a segment only contains tombstone documents. In that case, loading min and max @timestamp field values can result into NPE. Because these documents don't have a @timestamp field. This change fixes that by checking for the existence of the @timestamp field in the a segment's field infos.
- Loading branch information
Showing
4 changed files
with
97 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 96461 | ||
summary: Fix NPE when indexing a document that just has been deleted in a tsdb index | ||
area: TSDB | ||
type: bug | ||
issues: [] |
73 changes: 73 additions & 0 deletions
73
rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/delete/70_tsdb.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,73 @@ | ||
--- | ||
"basic tsdb delete": | ||
- skip: | ||
version: " - 8.8.0" | ||
reason: fixed in 8.8.1 | ||
|
||
- do: | ||
indices.create: | ||
index: weather_sensors | ||
body: | ||
settings: | ||
index: | ||
mode: time_series | ||
routing_path: [sensor_id, location] | ||
time_series: | ||
start_time: 2000-01-01T00:00:00.000Z | ||
end_time: 2099-12-31T23:59:59.999Z | ||
number_of_replicas: 0 | ||
number_of_shards: 1 | ||
mappings: | ||
properties: | ||
"@timestamp": | ||
type: date | ||
humidity: | ||
type: half_float | ||
time_series_metric: gauge | ||
location: | ||
type: keyword | ||
time_series_dimension: true | ||
sensor_id: | ||
type: keyword | ||
time_series_dimension: true | ||
temperature: | ||
type: half_float | ||
time_series_metric: gauge | ||
|
||
- do: | ||
index: | ||
index: weather_sensors | ||
body: | ||
"@timestamp": 2023-05-31T08:41:15.000Z | ||
sensor_id: SYKENET-000001 | ||
location: swamp | ||
temperature: 32.4 | ||
humidity: 88.9 | ||
- match: { _id: crxuhC8WO3aVdhvtAAABiHD35_g } | ||
- match: { result: created } | ||
- match: { _version: 1 } | ||
|
||
- do: | ||
delete: | ||
index: weather_sensors | ||
id: crxuhC8WO3aVdhvtAAABiHD35_g | ||
- match: { _id: crxuhC8WO3aVdhvtAAABiHD35_g } | ||
- match: { result: deleted } | ||
- match: { _version: 2 } | ||
|
||
- do: | ||
indices.flush: | ||
index: weather_sensors | ||
|
||
- do: | ||
index: | ||
index: weather_sensors | ||
body: | ||
"@timestamp": 2023-05-31T08:41:15.000Z | ||
sensor_id: SYKENET-000001 | ||
location: swamp | ||
temperature: 32.4 | ||
humidity: 88.9 | ||
- match: { _id: crxuhC8WO3aVdhvtAAABiHD35_g } | ||
- match: { result: created } | ||
- match: { _version: 3 } |
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