Conversation
It turns out that there is a fairly simple recipe for reindexing to a `time_series` index: 1. If you are reindexing from a time series index to a time series index and *not* changing the `@timestamp` or dimensions it "just works"(TM). 2. If you are reindexing from a standard index with a standard random `_id` you should clear it on reindex. 3. If you are reindexing from tsdb index to a tsdb index and modifying a dimension or `@timestamp` then you should clear the `_id`. This is not pleasant to have to remember. But it doesn't crash!
|
Pinging @elastic/es-analytics-geo (Team:Analytics) |
|
Pinging @elastic/es-distributed (Team:Distributed) |
|
Hi @nik9000, I've created a changelog YAML for you. |
|
Pinging @elastic/clients-team (Team:Clients) |
This teaches reindex the smallest thing that it needs to know about tsdb: `_id` is automatically generated. Armed with that knowledge reindex now doesn't attempt to copy the `_id` when writing to a tsdb index. Important: If the index doesn't yet exist it will *assume* that the index will be created in `standard` mode. We can detect what mode it *should* be created with in a follow up change.
|
|
||
| // id and source always come from the found doc. Scripts can change them but they operate on the index request. | ||
| index.id(doc.getId()); | ||
| index.id(destinationIndexIdMapper.reindexId(doc.getId())); |
There was a problem hiding this comment.
this will probably also speed reindex up
There was a problem hiding this comment.
I don't think so. It's a noop for standard indices. For tsdb indices it saves us some bits on the wire and a comparison. We still have to regenerate the id.
docs/changelog/86647.yaml
Outdated
| @@ -0,0 +1,5 @@ | |||
| pr: 86647 | |||
There was a problem hiding this comment.
Should this be mentioned here? I don't think this changes anything with the tsdb feature flag in place? If so then we should label this PR also as non-issue.
There was a problem hiding this comment.
Silly generated thing....
|
run elasticsearch-ci/packaging-tests-windows-sample |
This teaches reindex the smallest thing that it needs to know about
tsdb:
_idis automatically generated. Armed with that knowledgereindex now doesn't attempt to copy the
_idwhen writing to a tsdbindex.
Important: If the index doesn't yet exist it will assume that the
index will be created in
standardmode. We can detect what mode itshould be created with in a follow up change.