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

HOTFIX: Only measure in nano when producer metadata refresh is required #12102

Merged

Conversation

guozhangwang
Copy link
Contributor

We added the metadata wait time in total blocked time (#11805). But we added it in the critical path of send which is called per-record, whereas metadata refresh only happens rarely. This way the cost of time.nanos becomes unnecessarily significant as we call it twice per record.

This PR moves the call to inside the waitOnMetadata callee and only when we do need to wait for a metadata refresh round-trip (i.e. we are indeed blocking).

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@guozhangwang
Copy link
Contributor Author

cc @rodesai for a quick look.

@guozhangwang guozhangwang merged commit e026384 into apache:trunk Apr 27, 2022
@guozhangwang guozhangwang deleted the KHOT-nano-on-metadata-refresh branch April 27, 2022 18:28
@guozhangwang
Copy link
Contributor Author

Hi @cadonna could you please lmk if I can cherry-pick it to 3.2 as well?

@cadonna
Copy link
Contributor

cadonna commented Apr 28, 2022

@guozhangwang I do not think we need this hotfix on 3.2 since #11805 is not present on the 3.2 branch.

@guozhangwang
Copy link
Contributor Author

Ah yes :) my bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants