elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.86k stars 24.72k forks source link

MapperBuilderContext#isDataStream is incorrect when handling mapping updates #110726

Open lkts opened 3 months ago

lkts commented 3 months ago

Elasticsearch Version

8.15

Installed Plugins

No response

Java Version

bundled

OS Version


Problem Description

See https://github.com/elastic/elasticsearch/pull/110603#discussion_r1669358675.

Steps to Reproduce

  1. Create a time series mode index with default mapping only
  2. Update mapping with {"@timestamp": {"type": "date"}} (or anything really)

For this mapping update isDataStream is false even though it was true when index was created.

Logs (if relevant)

No response

elasticsearchmachine commented 3 months ago

Pinging @elastic/es-storage-engine (Team:StorageEngine)

elasticsearchmachine commented 3 months ago

Pinging @elastic/es-search-foundations (Team:Search Foundations)

javanna commented 2 months ago

I stumbled upon this too quite recently. This is similar to another issue I fixed with #109963 caused by not propagating flags to the MapperBuilderContext constructor.

I could not tell for sure if this is a problem or not, given where isDataStream is used. I also have suspicions that this may end up causing #107760 . I can see that you found this problem as part of extending where isDataStream was used, was that it or did you see additional issues?

lkts commented 2 months ago

So far i have only had problems with this in #110603 and i ended up working around it.