Skip to content

KAFKA-18600 Cleanup NetworkClient zk related logging#18644

Merged
chia7712 merged 11 commits into
apache:trunkfrom
m1a2st:KAFKA-18600
Aug 26, 2025
Merged

KAFKA-18600 Cleanup NetworkClient zk related logging#18644
chia7712 merged 11 commits into
apache:trunkfrom
m1a2st:KAFKA-18600

Conversation

@m1a2st

@m1a2st m1a2st commented Jan 20, 2025

Copy link
Copy Markdown
Collaborator

This PR removes associated logging within NetworkClient to reduce noise
and streamline the client code.

Reviewers: Ismael Juma ismael@juma.me.uk, David Arthur
mumrah@gmail.com, Chia-Ping Tsai chia7712@gmail.com

@github-actions github-actions Bot added triage PRs from the community clients small Small PRs labels Jan 20, 2025
log.debug("Node {} has finalized features epoch: {}, finalized features: {}, supported features: {}, ZK migration ready: {}, API versions: {}.",
log.debug("Node {} has finalized features epoch: {}, finalized features: {}, supported features: {}, API versions: {}.",
node, apiVersionsResponse.data().finalizedFeaturesEpoch(), apiVersionsResponse.data().finalizedFeatures(),
apiVersionsResponse.data().supportedFeatures(), apiVersionsResponse.data().zkMigrationReady(), nodeVersionInfo);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(Unrelated to this PR) @mumrah Do we have a plan to remove this field from the protocol api? We would need to ensure it's done in a compatible way, but it would be nice not to have this field in request logs and general logging.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since it's a tagged field and 4.0 cannot be the target of a ZK migration, we could just remove it without a version bump. However, we might consider keeping it around so that 4.0+ controllers can reject errant registrations from a Zk broker (like due to a misconfiguration).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Interesting, would this be from a broker that is being migrated?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh actually I was confusing this with the same field in the broker registration request. Looking at usages in 3.9, I'm not sure we ever used this field. I'll dig in a bit on this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This field (ZkMigrationReady in ApiVersionsResponse) was last used in 3.6. Starting in 3.7, we used the controller registration RPC in lieu of this field. So, it seems a bit like dead code at this point. We should probably leave the field in the RPC so we don't reuse the tagged field number, but we can set the max versions to v4 and remove the usages in the non-generated code.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sounds good.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we can set the max versions to v4

Pardon me, it seems to me the max version is already set to v4 (ApiKeys.API_VERSIONS.latestVersion()). Please correct me if I misunderstand anything.

we might consider keeping it around so that 4.0+ controllers can reject errant registrations from a Zk broker (like due to a misconfiguration).

it seems that is addressed already.

throw new BrokerIdNotRegisteredException("Controller does not support registering ZK brokers.");

remove the usages in the non-generated code.

I prefer to remove isMigratingZkBroker and IsMigratingZkBroker from non-generated code. similar to my previous comment #17293 (comment)

@github-actions github-actions Bot removed the triage PRs from the community label Jan 25, 2025

@mumrah mumrah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@m1a2st

m1a2st commented Mar 11, 2025

Copy link
Copy Markdown
Collaborator Author

Hello @mumrah, If there are no further changes needed for this PR, perhaps it can be merged. Thanks.

@chia7712
chia7712 merged commit 08057ea into apache:trunk Aug 26, 2025
24 checks passed
eduwercamacaro pushed a commit to littlehorse-enterprises/kafka that referenced this pull request Nov 12, 2025
This PR removes associated logging within NetworkClient to reduce noise
and streamline the client code.

Reviewers: Ismael Juma <ismael@juma.me.uk>, David Arthur
 <mumrah@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants