Skip to content

Conversation

@PeteGillinElastic
Copy link
Member

This prevents collisions in the enrich cache for different projects.

Collisions would be unlikely without this chance, since the key includes the index name, and the index name includes a millisecond-precision timestamp, so it would only happen if two projects executed enrich policies with the same name at the same time, or if one project manipulated the alias to match the timestamp of the other project.

However, collisions would have serious consequences (allowing read-across of data between projects). This change closes that gap.

This prevents collisions in the enrich cache for different projects.

Collisions would be unlikely without this chance, since the key
includes the index name, and the index name includes a
millisecond-precision timestamp, so it would only happen if two
projects executed enrich policies with the same name at the same time,
or if one project manipulated the alias to match the timestamp of the
other project.

However, collisions would have serious consequences (allowing
read-across of data between projects). This change closes that gap.
@PeteGillinElastic PeteGillinElastic force-pushed the ES-10936-mp-enrich-cache branch from 7ebab8d to a7c4467 Compare June 4, 2025 15:38
@PeteGillinElastic PeteGillinElastic marked this pull request as ready for review June 4, 2025 15:40
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Jun 4, 2025
@PeteGillinElastic PeteGillinElastic added >non-issue :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP and removed needs:triage Requires assignment of a team area label labels Jun 4, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Jun 4, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

Copy link
Contributor

@nielsbauman nielsbauman left a comment

Choose a reason for hiding this comment

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

LGTM

*/
// Visibility for testing
record CacheKey(String enrichIndex, Object lookupValue, int maxMatches) {
record CacheKey(String enrichIndex, ProjectId projectId, Object lookupValue, int maxMatches) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Tiniest nit ever: intuitively, I would have put the project ID as the first parameter because it has the largest "scope". Maybe that's just a weird personal preference I have, so this is definitely optional.

Copy link
Member Author

Choose a reason for hiding this comment

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

No, that makes sense. Done, and thanks.

@PeteGillinElastic PeteGillinElastic merged commit 3721613 into elastic:main Jun 5, 2025
18 checks passed
@PeteGillinElastic PeteGillinElastic deleted the ES-10936-mp-enrich-cache branch June 5, 2025 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP >non-issue Team:Data Management Meta label for data/management team v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants