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

Simplify TransportStats assertions in v9 #114700

Merged
merged 19 commits into from
Feb 5, 2025

Conversation

arteam
Copy link
Contributor

@arteam arteam commented Oct 14, 2024

Transport handling times were added in #80581 (8.1), we don't need assertions for version prior to that in 9.0

Transport handling times were added in elastic#80581 (8.1),
we don't need assertions for version prior to that in 9.0
@arteam arteam marked this pull request as ready for review October 16, 2024 15:20
@arteam arteam requested review from ldematte and DaveCTurner and removed request for ldematte October 16, 2024 15:20
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Oct 16, 2024
@arteam arteam requested a review from nicktindall October 24, 2024 10:00
Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

I would prefer that we clean up the de/serialization code at this point too.

@arteam arteam changed the title Simplfy TransportStats assertions in v9 Simplify TransportStats assertions in v9 Dec 4, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Distributed Coordination Meta label for Distributed Coordination team label Dec 4, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@arteam arteam force-pushed the v9-transport-stats-assertions branch from 929dda9 to bb59b3b Compare February 5, 2025 10:02
@arteam arteam added v9.0.1 auto-backport Automatically create backport pull requests when merged labels Feb 5, 2025
@arteam arteam requested a review from DaveCTurner February 5, 2025 11:15
Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

I think there's room for further simplification here, or at least better alignment between the serialization and deserialization code - see comment inline.

if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) {
assert (inboundHandlingTimeBucketFrequencies.length > 0) == (outboundHandlingTimeBucketFrequencies.length > 0);
assert (inboundHandlingTimeBucketFrequencies.length > 0) == (outboundHandlingTimeBucketFrequencies.length > 0);
if (out.getTransportVersion().before(TransportVersions.TRANSPORT_STATS_HANDLING_TIME_REQUIRED)) {
out.writeBoolean(inboundHandlingTimeBucketFrequencies.length > 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't match up with the reading code which requires these things to have length HandlingTimeTracker.BUCKET_COUNT.

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've hardened up the assertions on the bucket frequencies length in efc71fd

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

LGTM

Again, pretty important to backport this to v9.0

@arteam arteam added v9.0.0 and removed v9.0.0 labels Feb 5, 2025
@arteam arteam merged commit 94d7f22 into elastic:main Feb 5, 2025
17 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
9.0 Commit could not be cherrypicked due to conflicts

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

arteam added a commit to arteam/elasticsearch that referenced this pull request Feb 5, 2025
Backports elastic#114700 to 9.0

> Transport handling times were added in elastic#80581 (8.1), we don't need assertions for version prior to that in 9.0
@arteam arteam deleted the v9-transport-stats-assertions branch February 5, 2025 15:03
elasticsearchmachine pushed a commit that referenced this pull request Feb 5, 2025
Backports #114700 to 9.0

> Transport handling times were added in #80581 (8.1), we don't need assertions for version prior to that in 9.0
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 backport pending :Distributed Coordination/Network Http and internode communication implementations >non-issue >refactoring Team:Distributed Coordination Meta label for Distributed Coordination team Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v9.0.1 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants