Search coordinator uses event.ingested in cluster state to do rewrites#110352
Conversation
|
Pinging @elastic/es-search (Team:Search) |
|
Hi @quux00, I've created a changelog YAML for you. |
javanna
left a comment
There was a problem hiding this comment.
I left a couple of comments on internal API design etc.
…ses-event.ingested-in-cluster-state
It now looks up time range from timeseries if the @timestamp range from cluster state is not useful (UKNOWN) or not ready (not all shards accounted for). It no longer also depends on eventIngested being in a non-ready/non-usable state.
…ses-event.ingested-in-cluster-state
…xt and replaced Map<String, DataFieldType> with it
…ses-event.ingested-in-cluster-state
javanna
left a comment
There was a problem hiding this comment.
thanks, almost there, a couple more questions.
…and made it immutable
…ses-event.ingested-in-cluster-state
javanna
left a comment
There was a problem hiding this comment.
LGTM (left a small question, no need for another review round)
| * @return min timestamp for the field from IndexMetadata in cluster state. | ||
| */ | ||
| long getMinTimestamp(String fieldName) { | ||
| if (fieldName.equals(DataStream.TIMESTAMP_FIELD_NAME)) { |
There was a problem hiding this comment.
super minor nitpick: fieldName can never be null right? I see that getMaxTimestamp does the equal the other way around, that's not going to throw NPE, while this one is different. Perhaps it does not matter, but I wondered why.
There was a problem hiding this comment.
Thanks, good catch. I'll make them consistent.
|
buildkite test this |
…ses-event.ingested-in-cluster-state
elastic#110352) Min/max range for the event.ingested timestamp field (part of Elastic Common Schema) was added to IndexMetadata in cluster state for searchable snapshots in elastic#106252. This commit modifies the search coordinator to rewrite searches to MatchNone if the query searches a range of event.ingested that, from the min/max range in cluster state, is known to not overlap. This is the same behavior we currently have for the @timestamp field.
#110352) (#110782) Min/max range for the event.ingested timestamp field (part of Elastic Common Schema) was added to IndexMetadata in cluster state for searchable snapshots in #106252. This commit modifies the search coordinator to rewrite searches to MatchNone if the query searches a range of event.ingested that, from the min/max range in cluster state, is known to not overlap. This is the same behavior we currently have for the @timestamp field.
martijnvg
left a comment
There was a problem hiding this comment.
LGTM2 (I thought I clicked submit review)
| /** | ||
| * Data holder of timestamp fields held in cluster state IndexMetadata. | ||
| */ | ||
| public final class DateFieldRangeInfo { |
There was a problem hiding this comment.
I think this can be a record?
… rewrites (elastic#110352)" This reverts commit d45d164.
… rewrites (elastic#110352) (elastic#110782)" This reverts commit 9092394.
#110352) Min/max range for the event.ingested timestamp field (part of Elastic Common Schema) was added to IndexMetadata in cluster state for searchable snapshots in #106252. This commit modifies the search coordinator to rewrite searches to MatchNone if the query searches a range of event.ingested that, from the min/max range in cluster state, is known to not overlap. This is the same behavior we currently have for the @timestamp field.
#110352) Min/max range for the event.ingested timestamp field (part of Elastic Common Schema) was added to IndexMetadata in cluster state for searchable snapshots in #106252. This commit modifies the search coordinator to rewrite searches to MatchNone if the query searches a range of event.ingested that, from the min/max range in cluster state, is known to not overlap. This is the same behavior we currently have for the @timestamp field.
Min/max range for the event.ingested timestamp field (part of Elastic Common
Schema) was added to IndexMetadata in cluster state for searchable snapshots
in #106252.
This commit modifies the search coordinator to rewrite searches to MatchNone
if the query searches a range of event.ingested that, from the min/max range
in cluster state, is known to not overlap. This is the same behavior we currently
have for the
@timestampfield.