Simplify expectedFinalRegisterValue computation#131274
Merged
DaveCTurner merged 2 commits intoelastic:mainfrom Jul 16, 2025
Merged
Simplify expectedFinalRegisterValue computation#131274DaveCTurner merged 2 commits intoelastic:mainfrom
expectedFinalRegisterValue computation#131274DaveCTurner merged 2 commits intoelastic:mainfrom
Conversation
In repository analysis we keep an `AtomicLong` counting the number of successfully-completed increments on the contended register, but we only check this value if all the increments succeed. We know how many increments we enqueue up-front so there's no need to count them as they complete. This commit removes the unnecessary counter.
Collaborator
|
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
| if (minClusterTransportVersion.onOrAfter(TransportVersions.V_8_8_0)) { | ||
| final String contendedRegisterName = CONTENDED_REGISTER_NAME_PREFIX + UUIDs.randomBase64UUID(random); | ||
| final AtomicBoolean contendedRegisterAnalysisComplete = new AtomicBoolean(); | ||
| final int registerOperations = Math.max(nodes.size(), request.getRegisterOperationCount()); |
Contributor
There was a problem hiding this comment.
When would this value need to be nodes.size()? Ie, if we have 5 nodes but there have been nothing registered so far, does it make sense to be passing 5 as a parameter here?
Contributor
Author
There was a problem hiding this comment.
I think you're reading "register" as a verb, but it's a noun here. The variable name registerOperations means "number of operations on the register".
Contributor
Author
There was a problem hiding this comment.
... and we want to do at least one such operation from every node, maybe more if requested:
szybia
added a commit
to szybia/elasticsearch
that referenced
this pull request
Jul 16, 2025
…king * upstream/main: (91 commits) Mute org.elasticsearch.packaging.test.DockerTests test130JavaHasCorrectOwnership elastic#131369 Add exception logging when interrupted (elastic#131153) Mute org.elasticsearch.packaging.test.DockerTests test140CgroupOsStatsAreAvailable elastic#131372 Mute org.elasticsearch.packaging.test.DockerTests test070BindMountCustomPathConfAndJvmOptions elastic#131366 Mute org.elasticsearch.xpack.test.rest.XPackRestIT test {p0=ml/delete_expired_data/Test delete expired data with body parameters} elastic#131364 Mute org.elasticsearch.xpack.esql.vector.VectorSimilarityFunctionsIT testSimilarityBetweenConstantVectorAndField {functionName=v_cosine similarityFunction=COSINE} elastic#131363 Mute org.elasticsearch.xpack.esql.vector.VectorSimilarityFunctionsIT testDifferentDimensions {functionName=v_cosine similarityFunction=COSINE} elastic#131362 Mute org.elasticsearch.xpack.esql.vector.VectorSimilarityFunctionsIT testSimilarityBetweenConstantVectors {functionName=v_cosine similarityFunction=COSINE} elastic#131361 Check SCORE_FUNCTION capability in VerifierTests (elastic#131352) Replace deprecated routingTable table call in tests (elastic#131005) [DOCS] Remove misused applies_to tag (elastic#131349) Adj ivf postings list building (elastic#130843) [Transform] Read metadata from Project State (elastic#131205) Add note on o11y to architecture guide (elastic#131291) Upgrade AWS Java SDK to 2.31.78 (elastic#131050) Support Fields API in conditional ingest processors (elastic#121914) ESQL - KNN function uses prefilters when pushed down to Lucene (elastic#131004) Add docs for ES|QL query logs (elastic#131287) Simplify `expectedFinalRegisterValue` computation (elastic#131274) Mute org.elasticsearch.test.rest.yaml.RcsCcsCommonYamlTestSuiteIT test {p0=search/110_field_collapsing/field collapsing, inner_hits and maxConcurrentGroupRequests} elastic#131348 ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In repository analysis we keep an
AtomicLongcounting the number ofsuccessfully-completed increments on the contended register, but we only
check this value if all the increments succeed. We know how many
increments we enqueue up-front so there's no need to count them as they
complete. This commit removes the unnecessary counter.