Skip to content

Event based fetcher part 1/3: Adding the AbstractAsyncFetcher with current methods#121

Merged
gitlw merged 3 commits into
linkedin:2.4-lifrom
gitlw:event_based_fetcher_1
Mar 16, 2021
Merged

Event based fetcher part 1/3: Adding the AbstractAsyncFetcher with current methods#121
gitlw merged 3 commits into
linkedin:2.4-lifrom
gitlw:event_based_fetcher_1

Conversation

@gitlw

@gitlw gitlw commented Mar 11, 2021

Copy link
Copy Markdown

This PR is the first of 3 PRs to implement proposal 1 and proposal 3 of the design https://docs.google.com/document/d/1PZAOwpw09tVDeuSP0OBVhB6dbgz7C7dQU6bRkePQ8qg/edit#. This PR adds a new AbstractAsyncFetcher class that will be used as the event processer(handler) in the new event-based fetcher model. In this PR, all the methods of the AbstractAsyncFetcher class are copied from the existing class AbstractFetcherThread, with a slight modification: the usage of partitionMapLock and partitionMapCond have been removed. The lock and condition variables are removed since the state of this class will be changed only by one thread in the event-based model.

In the next PR, a few new methods will be added to the AbstractAsyncFetcher class, which will use these copied methods to implement the replication protocol.

Also added are two util classes AsyncFetcherStats and AsyncFetcherLagStats, which are copied from the existing classes
FetcherStats and FetcherLagStats respectively. Creating these two new classes can make the event-based implementation completely separate from the current lock-based implementation.

Committer Checklist (excluded from commit message)

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

@ambroff ambroff 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.

Looks good. Thank you for breaking this up into digestible chunks.

I left a question but I think it will probably be answered in the followup PR.

+1.

Comment thread core/src/main/scala/kafka/server/AbstractAsyncFetcher.scala Outdated
Comment thread core/src/main/scala/kafka/server/AbstractAsyncFetcher.scala
@smccauliff

Copy link
Copy Markdown

Was this extracted from existing Kafka code? Which option in the design doc is being implemented here?

@gitlw

gitlw commented Mar 16, 2021

Copy link
Copy Markdown
Author

@smccauliff Yes, the methods in this PR are pretty much copied from the existing kafka code base with slight modifications, which are mainly about the removal of the partitionMapLock and partitionMapCond variable. This series of 3 PRs will be implementing proposal 1 and proposal 3 in the design doc.

@gitlw gitlw merged commit 770d097 into linkedin:2.4-li Mar 16, 2021
@gitlw gitlw deleted the event_based_fetcher_1 branch March 16, 2021 18:45
gitlw added a commit to gitlw/kafka that referenced this pull request Feb 24, 2022
…cher with current methods (linkedin#121)

TICKET = KAFKA-10734
LI_DESCRIPTION = Part 1 of 3 PRs to change the fetcher into event-based model
EXIT_CRITERIA = When KAFKA-10734 is closed and the changes are pulled in as a part of a release
lmr3796 pushed a commit to lmr3796/kafka that referenced this pull request Mar 25, 2022
…cher with current methods (linkedin#121)

TICKET = KAFKA-10734
LI_DESCRIPTION = Part 1 of 3 PRs to change the fetcher into event-based model
EXIT_CRITERIA = When KAFKA-10734 is closed and the changes are pulled in as a part of a release
lmr3796 pushed a commit to lmr3796/kafka that referenced this pull request Jun 2, 2022
…cher with current methods (linkedin#121)

TICKET = KAFKA-10734
LI_DESCRIPTION = Part 1 of 3 PRs to change the fetcher into event-based model
EXIT_CRITERIA = When KAFKA-10734 is closed and the changes are pulled in as a part of a release
earlcoder added a commit that referenced this pull request Apr 28, 2026
The async/event-based replica fetcher series (TransferLeaderManager,
AbstractAsyncFetcher, AsyncReplicaFetcher, FetcherEventBus,
FetcherEventManager — PRs #121/#123/#124/#143/#144/#403/#406) was
removed in the PR #538 squash. The li.async.fetcher.enable config key
was left behind in KafkaConfig as dead surface area: it parsed and
validated, but had no consumers.

Going with audit P1 #6 option (a): retire the feature, remove the dead
config key. Operators with li.async.fetcher.enable=<anything> in their
server.properties may see an 'Unknown configuration' warning at broker
startup; this is harmless — the broker still starts and the value would
have been a no-op anyway.

Removes:
- Defaults.LiAsyncFetcherEnabled
- KafkaConfig.LiAsyncFetcherEnableProp
- The brokerConfigDef.define(...) registration
- KafkaConfig.liAsyncFetcherEnable accessor

Audit option (b) — porting the entire async fetcher series forward
into 3.6-li — was deferred. If the optimization is needed in the
future, it would need to be reimplemented from scratch on top of
upstream's current ReplicaFetcherThread / ReplicaFetcherManager.
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.

3 participants