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

Repo analysis: allow configuration of register ops #102051

Conversation

DaveCTurner
Copy link
Contributor

Adds the ?register_operation_count parameter that allows to control
the number of register operations separately from the number of regular
blob operations.

Adds the `?register_operation_count` parameter that allows to control
the number of register operations separately from the number of regular
blob operations.
@DaveCTurner DaveCTurner added >enhancement :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v8.12.0 labels Nov 12, 2023
Copy link

Documentation preview:

@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Distributed Meta label for distributed team label Nov 12, 2023
Copy link
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

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

I have a question about usage of synchronization in test.

@@ -488,7 +488,7 @@ public void run() {
)
)
) {
final int registerOperations = Math.max(nodes.size(), request.getConcurrency());
final int registerOperations = Math.max(nodes.size(), request.getRegisterOperationCount());
Copy link
Member

Choose a reason for hiding this comment

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

This doc says the number of register operation defaults to 10. But the actual number is a max between number of nodes and number of register operations. Should we explain this nuance in the doc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm inclined to say no, because I tried describing this in the docs and it just seemed to make it harder to understand. We do more uncontended register ops too because they carry on until the contended ones finish. I'd be amazed if anyone notices this in practice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Eh how about a93f159? Added the word minimum to those docs, I think that covers everything simply enough.

Comment on lines 507 to 508
synchronized (registerMutex) {
witness = registers.computeIfAbsent(key, ignored -> new BytesRegister()).compareAndExchange(expected, updated);
Copy link
Member

Choose a reason for hiding this comment

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

Does this synchronization introduce an artificial serialization of operations that means we are not really testing compareAndExchange in a concurrent fashion? Is this a problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the correctness of this compareAndExchange (itself implemented as a synchronized method) isn't really the subject of this test. I added a comment in 2b4b3c7.

Copy link
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

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

LGTM

@DaveCTurner DaveCTurner added the auto-merge Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Nov 13, 2023
@elasticsearchmachine elasticsearchmachine merged commit 8572d6e into elastic:main Nov 13, 2023
13 checks passed
@DaveCTurner DaveCTurner deleted the 2023/11/12/repo-analysis-configure-register-ops branch November 13, 2023 07:20
davidkyle pushed a commit to davidkyle/elasticsearch that referenced this pull request Nov 13, 2023
Adds the `?register_operation_count` parameter that allows to control
the number of register operations separately from the number of regular
blob operations.
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Nov 14, 2023
In 8.12 users can configure the number of register operations performed
by repository analysis, but this configuration is not available in
earlier versions. Nonetheless, we should at least mention that
repository analysis does some register operations. This commit backports
the few relevant lines of the docs changes from elastic#102051 to earlier
branches.

Relates elastic#102050
elasticsearchmachine pushed a commit that referenced this pull request Nov 14, 2023
In 8.12 users can configure the number of register operations performed
by repository analysis, but this configuration is not available in
earlier versions. Nonetheless, we should at least mention that
repository analysis does some register operations. This commit backports
the few relevant lines of the docs changes from #102051 to earlier
branches.

Relates #102050
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Nov 14, 2023
In 8.12 users can configure the number of register operations performed
by repository analysis, but this configuration is not available in
earlier versions. Nonetheless, we should at least mention that
repository analysis does some register operations. This commit backports
the few relevant lines of the docs changes from elastic#102051 to earlier
branches.

Relates elastic#102050
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Nov 14, 2023
In 8.12 users can configure the number of register operations performed
by repository analysis, but this configuration is not available in
earlier versions. Nonetheless, we should at least mention that
repository analysis does some register operations. This commit backports
the few relevant lines of the docs changes from elastic#102051 to earlier
branches.

Relates elastic#102050
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Nov 14, 2023
In 8.12 users can configure the number of register operations performed
by repository analysis, but this configuration is not available in
earlier versions. Nonetheless, we should at least mention that
repository analysis does some register operations. This commit backports
the few relevant lines of the docs changes from elastic#102051 to earlier
branches.

Relates elastic#102050
elasticsearchmachine pushed a commit that referenced this pull request Nov 14, 2023
In 8.12 users can configure the number of register operations performed
by repository analysis, but this configuration is not available in
earlier versions. Nonetheless, we should at least mention that
repository analysis does some register operations. This commit backports
the few relevant lines of the docs changes from #102051 to earlier
branches.

Relates #102050
elasticsearchmachine pushed a commit that referenced this pull request Nov 14, 2023
In 8.12 users can configure the number of register operations performed
by repository analysis, but this configuration is not available in
earlier versions. Nonetheless, we should at least mention that
repository analysis does some register operations. This commit backports
the few relevant lines of the docs changes from #102051 to earlier
branches.

Relates #102050
elasticsearchmachine pushed a commit that referenced this pull request Nov 14, 2023
In 8.12 users can configure the number of register operations performed
by repository analysis, but this configuration is not available in
earlier versions. Nonetheless, we should at least mention that
repository analysis does some register operations. This commit backports
the few relevant lines of the docs changes from #102051 to earlier
branches.

Relates #102050
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >enhancement Team:Distributed Meta label for distributed team v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants