Skip to content

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Sep 18, 2025

Primary ids are only incremented on the main branch. For release branches only patch ids will be created. The primary id validation won't always work on release branches because only some of the primary ids will be backported.

This commit skips primary id validation if we are sure we are on a release branch. We can tell this by looking at the current upper bound compared to other upper bounds. If there is a newer one, we know we are on a release branch. If there isn't a newer one, we might be on a release branch, or on main, but in this case doing primary id validation is ok because there's effectively no difference, we are looking at the latest upper bound.

Primary ids are only incremented on the main branch. For release branches
only patch ids will be created. The primary id validation won't always
work on release branches because only some of the primary ids will be
backported.

This commit skips primary id validation if we are sure we are on a
release branch. We can tell this by looking at the current upper bound
compared to other upper bounds. If there is a newer one, we know we are
on a release branch. If there isn't a newer one, we _might_ be on a
release branch, or on main, but in this case doing primary id validation
is ok because there's effectively no difference, we are looking at the
latest upper bound.
@rjernst rjernst requested a review from a team as a code owner September 18, 2025 22:24
@elasticsearchmachine elasticsearchmachine added v9.2.0 Team:Core/Infra Meta label for core/infra team labels Sep 18, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

TransportVersionUpperBound currentUpperBound = upperBounds.get(currentUpperBoundName);

// non-main branches
for (TransportVersionUpperBound upperBound : upperBounds.values()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: FWIW, I like using streams here for stuff like this. For example:

return upperBounds.values().stream()
    .anyMatch(u -> u.definitionId().complete() > currentUpperBound.definitionId().complete())

@elasticsearchmachine elasticsearchmachine added the serverless-linked Added by automation, don't add manually label Sep 18, 2025
@rjernst rjernst merged commit e3c4c75 into elastic:main Sep 19, 2025
35 checks passed
@rjernst rjernst deleted the transport/primary_id_validation_release_branch branch September 19, 2025 14:20
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Sep 19, 2025
Primary ids are only incremented on the main branch. For release branches
only patch ids will be created. The primary id validation won't always
work on release branches because only some of the primary ids will be
backported.

This commit skips primary id validation if we are sure we are on a
release branch. We can tell this by looking at the current upper bound
compared to other upper bounds. If there is a newer one, we know we are
on a release branch. If there isn't a newer one, we _might_ be on a
release branch, or on main, but in this case doing primary id validation
is ok because there's effectively no difference, we are looking at the
latest upper bound.
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Sep 19, 2025
Primary ids are only incremented on the main branch. For release branches
only patch ids will be created. The primary id validation won't always
work on release branches because only some of the primary ids will be
backported.

This commit skips primary id validation if we are sure we are on a
release branch. We can tell this by looking at the current upper bound
compared to other upper bounds. If there is a newer one, we know we are
on a release branch. If there isn't a newer one, we _might_ be on a
release branch, or on main, but in this case doing primary id validation
is ok because there's effectively no difference, we are looking at the
latest upper bound.
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Sep 19, 2025
Primary ids are only incremented on the main branch. For release branches
only patch ids will be created. The primary id validation won't always
work on release branches because only some of the primary ids will be
backported.

This commit skips primary id validation if we are sure we are on a
release branch. We can tell this by looking at the current upper bound
compared to other upper bounds. If there is a newer one, we know we are
on a release branch. If there isn't a newer one, we _might_ be on a
release branch, or on main, but in this case doing primary id validation
is ok because there's effectively no difference, we are looking at the
latest upper bound.
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Sep 19, 2025
Primary ids are only incremented on the main branch. For release branches
only patch ids will be created. The primary id validation won't always
work on release branches because only some of the primary ids will be
backported.

This commit skips primary id validation if we are sure we are on a
release branch. We can tell this by looking at the current upper bound
compared to other upper bounds. If there is a newer one, we know we are
on a release branch. If there isn't a newer one, we _might_ be on a
release branch, or on main, but in this case doing primary id validation
is ok because there's effectively no difference, we are looking at the
latest upper bound.
@rjernst
Copy link
Member Author

rjernst commented Sep 19, 2025

9.0 backport: #135093
9.1 rolled into: #134947
8.19 rolled into: #134946
8.18 rolled into: #134948

elasticsearchmachine pushed a commit that referenced this pull request Sep 19, 2025
Primary ids are only incremented on the main branch. For release branches
only patch ids will be created. The primary id validation won't always
work on release branches because only some of the primary ids will be
backported.

This commit skips primary id validation if we are sure we are on a
release branch. We can tell this by looking at the current upper bound
compared to other upper bounds. If there is a newer one, we know we are
on a release branch. If there isn't a newer one, we _might_ be on a
release branch, or on main, but in this case doing primary id validation
is ok because there's effectively no difference, we are looking at the
latest upper bound.
elasticsearchmachine pushed a commit that referenced this pull request Sep 19, 2025
* Add more transport version validation cases (#134597)

This commit adds a few more validations:
* we cannot jump the primary id more than the normal increment
* we cannot remove an existing id

Also fixed definition path output in some validation error messages.

* Only validate primary ids on release branches (#135044)

Primary ids are only incremented on the main branch. For release branches
only patch ids will be created. The primary id validation won't always
work on release branches because only some of the primary ids will be
backported.

This commit skips primary id validation if we are sure we are on a
release branch. We can tell this by looking at the current upper bound
compared to other upper bounds. If there is a newer one, we know we are
on a release branch. If there isn't a newer one, we _might_ be on a
release branch, or on main, but in this case doing primary id validation
is ok because there's effectively no difference, we are looking at the
latest upper bound.

* fix compile
elasticsearchmachine pushed a commit that referenced this pull request Sep 19, 2025
* Add more transport version validation cases (#134597)

This commit adds a few more validations:
* we cannot jump the primary id more than the normal increment
* we cannot remove an existing id

Also fixed definition path output in some validation error messages.

* Only validate primary ids on release branches (#135044)

Primary ids are only incremented on the main branch. For release branches
only patch ids will be created. The primary id validation won't always
work on release branches because only some of the primary ids will be
backported.

This commit skips primary id validation if we are sure we are on a
release branch. We can tell this by looking at the current upper bound
compared to other upper bounds. If there is a newer one, we know we are
on a release branch. If there isn't a newer one, we _might_ be on a
release branch, or on main, but in this case doing primary id validation
is ok because there's effectively no difference, we are looking at the
latest upper bound.

* fix compile
szybia added a commit to szybia/elasticsearch that referenced this pull request Sep 19, 2025
* upstream/main:
  Turn NumericValues into functional interface (elastic#135068)
  Improve block loader for source only runtime fields of type keyword (elastic#135026)
  Mute org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecIT test {csv-spec:stats.StdDeviationGroupedAllTypes} elastic#135103
  Mute org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecIT test {csv-spec:stats.StdDeviationWithLongs} elastic#135102
  Mute org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecIT test {csv-spec:inlinestats.StdDevFilter} elastic#135101
  Mute org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecIT test {csv-spec:stats.StdDevFilter} elastic#135100
  Remove track_live_docs_in_memory_bytes feature flag (elastic#134900)
  Create SPI to allow prohibiting certain top-level mappings (elastic#132360)
  Only validate primary ids on release branches (elastic#135044)
  Added no-op support for project_routing query param to REST endpoints that will support cross-project search (elastic#134741)
  Fix race in FileSettingsServiceIT.testSettingsAppliedOnStart (elastic#134368)
elasticsearchmachine pushed a commit that referenced this pull request Sep 23, 2025
* Add more transport version validation cases (#134597)

This commit adds a few more validations:
* we cannot jump the primary id more than the normal increment
* we cannot remove an existing id

Also fixed definition path output in some validation error messages.

* Only validate primary ids on release branches (#135044)

Primary ids are only incremented on the main branch. For release branches
only patch ids will be created. The primary id validation won't always
work on release branches because only some of the primary ids will be
backported.

This commit skips primary id validation if we are sure we are on a
release branch. We can tell this by looking at the current upper bound
compared to other upper bounds. If there is a newer one, we know we are
on a release branch. If there isn't a newer one, we _might_ be on a
release branch, or on main, but in this case doing primary id validation
is ok because there's effectively no difference, we are looking at the
latest upper bound.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label >refactoring serverless-linked Added by automation, don't add manually Team:Core/Infra Meta label for core/infra team v8.18.8 v8.19.5 v9.0.8 v9.1.5 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants