Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce TimeSeriesRoutingIdFieldMapper and use it to create TSDB ids #106080

Merged
merged 85 commits into from
Mar 13, 2024

Conversation

kkrik-es
Copy link
Contributor

@kkrik-es kkrik-es commented Mar 7, 2024

Supporting non-keyword fields requires updating non-keyword fields in the routing path to be included in routing calculations. Routing is performed in coordinating nodes that lack mappings (or mappings haven't been created yet, for dynamically-defined dimensions), so the routing hash they calculate are passed to data nodes and stored in a new fields, namely _ts_routind_hash. This is included in the _id field, in turn, so that it can consistently reach the right shard for get-by-id and delete-by-id operations.

A few interesting points:

  • The hash is passed from the coordinating to data nodes using the routing field in IndexRequest; adding another field to the latter requires updating dozens of classes.
  • We explicitly skip (double-) storing the hash to the routing field, as the latter is not optimized for storage using the TSDB codec.
  • The routing hash may not be available in Translog operations, it can then be retrieved from the id prefix.

Related to #103567

@kkrik-es
Copy link
Contributor Author

kkrik-es commented Mar 9, 2024

@elasticsearchmachine run elasticsearch-ci/bwc-snapshots

@martijnvg
Copy link
Member

I think the engine level changes in this PR can be undone and use routing based on index mode in the mapping / document parser: martijnvg@609405c

The tests in server and data stream module passed with this change.

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is getting close! My main concern is around the change in yml test.

@kkrik-es
Copy link
Contributor Author

@elasticsearchmachine run elasticsearch-ci/part-1

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@kkrik-es
Copy link
Contributor Author

Thanks for the patience and the thorough review!

@kkrik-es kkrik-es added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >non-issue :StorageEngine/TSDB You know, for Metrics Team:StorageEngine v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants