Skip to content

Conversation

@DaveCTurner
Copy link
Contributor

Rather than checking the license (updating the usage map) on every
single shard, just do it once at the start of a computation that needs
to forecast write loads.

Closes #123247

Rather than checking the license (updating the usage map) on every
single shard, just do it once at the start of a computation that needs
to forecast write loads.

Closes elastic#123247
@DaveCTurner DaveCTurner added >bug :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. auto-backport Automatically create backport pull requests when merged v8.18.1 v8.19.0 v9.0.1 v9.1.0 v8.16.5 v8.17.3 labels Feb 25, 2025
@DaveCTurner DaveCTurner requested a review from fcofdez February 25, 2025 08:48
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Indexing Meta label for Distributed Indexing team label Feb 25, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @DaveCTurner, I've created a changelog YAML for you.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing)

Copy link
Contributor

@fcofdez fcofdez left a comment

Choose a reason for hiding this comment

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

LGTM. I expected that calling to that method would be cheap. Thanks for fixing this.


static {
try {
VH_HAS_VALID_LICENCE_FIELD = MethodHandles.lookup()
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need to use a VarHandle here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're checking the license state in a hot loop so I didn't want to introduce another layer of indirection on the read path, but I wanted an atomic getAndSet on the write path for the sake of getting the logging right. I'll add a comment.

@DaveCTurner
Copy link
Contributor Author

The test failures are genuine, this'll need more work.

@DaveCTurner DaveCTurner added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Feb 25, 2025
@elasticsearchmachine elasticsearchmachine merged commit d0db4cd into elastic:main Feb 25, 2025
17 checks passed
@DaveCTurner DaveCTurner deleted the 2025/02/25/write-load-forecast-licence-checks branch February 25, 2025 12:51
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Feb 25, 2025
Rather than checking the license (updating the usage map) on every
single shard, just do it once at the start of a computation that needs
to forecast write loads.

Closes elastic#123247
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.18 Commit could not be cherrypicked due to conflicts
8.x Commit could not be cherrypicked due to conflicts
9.0
8.16 Commit could not be cherrypicked due to conflicts
8.17 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 123346

DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Feb 25, 2025
Rather than checking the license (updating the usage map) on every
single shard, just do it once at the start of a computation that needs
to forecast write loads.

Backport of elastic#123346 to 8.x
Closes elastic#123247
@DaveCTurner
Copy link
Contributor Author

8.x-and-earlier backports in progress in #123369

elasticsearchmachine pushed a commit that referenced this pull request Feb 25, 2025
…3365)

Rather than checking the license (updating the usage map) on every
single shard, just do it once at the start of a computation that needs
to forecast write loads.

Closes #123247
DaveCTurner added a commit that referenced this pull request Feb 25, 2025
Rather than checking the license (updating the usage map) on every
single shard, just do it once at the start of a computation that needs
to forecast write loads.

Backport of #123346 to 8.x
Closes #123247
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Feb 25, 2025
Rather than checking the license (updating the usage map) on every
single shard, just do it once at the start of a computation that needs
to forecast write loads.

Backport of elastic#123346 to 8.x
Closes elastic#123247
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Feb 25, 2025
Rather than checking the license (updating the usage map) on every
single shard, just do it once at the start of a computation that needs
to forecast write loads.

Backport of elastic#123346 to 8.x
Closes elastic#123247
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Feb 25, 2025
Rather than checking the license (updating the usage map) on every
single shard, just do it once at the start of a computation that needs
to forecast write loads.

Backport of elastic#123346 to 8.x
Closes elastic#123247
elasticsearchmachine pushed a commit that referenced this pull request Feb 25, 2025
…3408)

Rather than checking the license (updating the usage map) on every
single shard, just do it once at the start of a computation that needs
to forecast write loads.

Backport of #123346 to 8.x
Closes #123247
elasticsearchmachine pushed a commit that referenced this pull request Feb 25, 2025
…3409)

Rather than checking the license (updating the usage map) on every
single shard, just do it once at the start of a computation that needs
to forecast write loads.

Backport of #123346 to 8.x
Closes #123247
elasticsearchmachine pushed a commit that referenced this pull request Feb 25, 2025
…3407)

Rather than checking the license (updating the usage map) on every
single shard, just do it once at the start of a computation that needs
to forecast write loads.

Backport of #123346 to 8.x
Closes #123247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >bug :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. Team:Distributed Indexing Meta label for Distributed Indexing team v8.16.5 v8.17.3 v8.18.1 v8.19.0 v9.0.1 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid license checks on every call to LicensedWriteLoadForecaster#getForecastedWriteLoad

3 participants