Skip to content

[LI-HOTFIX] Improving performance of the isReplicaOnline method (#206)#271

Merged
wyuka merged 1 commit into
linkedin:3.0-li-dev5from
wyuka:hotfix-206
Feb 4, 2022
Merged

[LI-HOTFIX] Improving performance of the isReplicaOnline method (#206)#271
wyuka merged 1 commit into
linkedin:3.0-li-dev5from
wyuka:hotfix-206

Conversation

@wyuka

@wyuka wyuka commented Feb 4, 2022

Copy link
Copy Markdown

TICKET = LIKAFKA-38536
LI_DESCRIPTION =

Original hotfix PR #206

The ControllerContext.isReplicaOnline method is frequently called inside a loop,
and internally this method relies on several derived fields in the ControllerContext.
Repeatedly calculating the derived fields could be expensive, and yet these fields
do not change between iterations of the loop.

This PR creates a new class ControllerContextSnapshot that tries to cache
the derived fields in order to save the repeated computation and speed up the
controller.

EXIT_CRITERIA = When this change is proposed in upstream kafka and pulled internally.

Committer Checklist (excluded from commit message)

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

@wyuka
wyuka requested a review from gitlw February 4, 2022 01:49
…he#206)

TICKET = LIKAFKA-38536
LI_DESCRIPTION =
The ControllerContext.isReplicaOnline method is frequently called inside a loop,
and internally this method relies on several derived fields in the ControllerContext.
Repeatedly calculating the derived fields could be expensive, and yet these fields
do not change between iterations of the loop.

This PR creates a new class ControllerContextSnapshot that tries to cache
the derived fields in order to save the repeated computation and speed up the
controller.

EXIT_CRITERIA = When this change is proposed in upstream kafka and pulled internally.

@gitlw gitlw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks!

@wyuka
wyuka merged commit cd465f9 into linkedin:3.0-li-dev5 Feb 4, 2022
lmr3796 pushed a commit to lmr3796/kafka that referenced this pull request Feb 9, 2022
…edin#206) (linkedin#271)

TICKET = LIKAFKA-38536
LI_DESCRIPTION =

Original hotfix PR linkedin#206

The ControllerContext.isReplicaOnline method is frequently called inside a loop,
and internally this method relies on several derived fields in the ControllerContext.
Repeatedly calculating the derived fields could be expensive, and yet these fields
do not change between iterations of the loop.

This PR creates a new class ControllerContextSnapshot that tries to cache
the derived fields in order to save the repeated computation and speed up the
controller.

EXIT_CRITERIA = When this change is proposed in upstream kafka and pulled internally.

Co-authored-by: Lucas Wang <luwang@linkedin.com>
lmr3796 pushed a commit to lmr3796/kafka that referenced this pull request Mar 25, 2022
…edin#206) (linkedin#271)

TICKET = LIKAFKA-38536
LI_DESCRIPTION =

Original hotfix PR linkedin#206

The ControllerContext.isReplicaOnline method is frequently called inside a loop,
and internally this method relies on several derived fields in the ControllerContext.
Repeatedly calculating the derived fields could be expensive, and yet these fields
do not change between iterations of the loop.

This PR creates a new class ControllerContextSnapshot that tries to cache
the derived fields in order to save the repeated computation and speed up the
controller.

EXIT_CRITERIA = When this change is proposed in upstream kafka and pulled internally.

Co-authored-by: Lucas Wang <luwang@linkedin.com>
lmr3796 pushed a commit to lmr3796/kafka that referenced this pull request Jun 2, 2022
…in#206) (linkedin#271)

TICKET = LIKAFKA-38536
LI_DESCRIPTION =

Original hotfix PR linkedin#206

The ControllerContext.isReplicaOnline method is frequently called inside a loop,
and internally this method relies on several derived fields in the ControllerContext.
Repeatedly calculating the derived fields could be expensive, and yet these fields
do not change between iterations of the loop.

This PR creates a new class ControllerContextSnapshot that tries to cache
the derived fields in order to save the repeated computation and speed up the
controller.

EXIT_CRITERIA = When this change is proposed in upstream kafka and pulled internally.

Co-authored-by: Lucas Wang <luwang@linkedin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants