Skip to content

KAFKA-13986; Brokers should include node.id in fetches to metadata quorum#12498

Merged
hachikuji merged 2 commits into
apache:trunkfrom
hachikuji:KAFKA-13986
Aug 11, 2022
Merged

KAFKA-13986; Brokers should include node.id in fetches to metadata quorum#12498
hachikuji merged 2 commits into
apache:trunkfrom
hachikuji:KAFKA-13986

Conversation

@hachikuji

Copy link
Copy Markdown
Contributor

Currently we do not set the replicaId in fetches from brokers to the metadata quorum. It is useful to do so since that allows us to debug replication using the DescribeQuorum API.

Committer Checklist (excluded from commit message)

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

@hachikuji

Copy link
Copy Markdown
Contributor Author

cc @dengziming @niket-goel @jsancio

Comment thread core/src/test/scala/unit/kafka/raft/RaftManagerTest.scala Outdated

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

We should also make some adjustments to DescribeQuorumRequestTest since we have observers now.

Comment thread core/src/test/scala/unit/kafka/raft/RaftManagerTest.scala Outdated

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

Thanks for the changes @hachikuji . Do we need this for 3.3.0?

} else {
OptionalInt.empty()
}
val nodeId = OptionalInt.of(config.nodeId)

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 did this to address this issue: https://issues.apache.org/jira/browse/KAFKA-13168. Do you think this is not needed anymore because we have this check in KafkaConfig?

        // nodeId must not appear in controller.quorum.voters
        require(!voterAddressSpecsByNodeId.containsKey(nodeId),
          s"If ${KafkaConfig.ProcessRolesProp} contains just the 'broker' role, the node id $nodeId must not be included in the set of voters ${KafkaConfig.QuorumVotersProp}=${voterAddressSpecsByNode  Id.asScala.keySet.toSet}")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, that is what I was thinking. Because we require the voter set to be consistently defined on all nodes, it seems like it is good enough to ensure that any node which starts with just the "broker" role is not among the voters. Do you agree with that?

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.

Okay. It is best we can do at the moment. We can revisit this when we have replicaUuid and storageId from KIP-853.

@jsancio jsancio 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

@jsancio jsancio added core Kafka Broker 3.3 labels Aug 10, 2022
@hachikuji hachikuji merged commit 24b0ebb into apache:trunk Aug 11, 2022
hachikuji added a commit that referenced this pull request Aug 11, 2022
…orum (#12498)

Currently we do not set the replicaId in fetches from brokers to the metadata quorum. It is useful to do so since that allows us to debug replication using the `DescribeQuorum` API.

Reviewers: dengziming <dengziming1993@gmail.com>, José Armando García Sancio <jsancio@users.noreply.github.com>
ijuma added a commit to franz1981/kafka that referenced this pull request Aug 12, 2022
* apache-github/trunk: (447 commits)
  KAFKA-13959: Controller should unfence Broker with busy metadata log (apache#12274)
  KAFKA-10199: Expose read only task from state updater (apache#12497)
  KAFKA-14154; Return NOT_CONTROLLER from AlterPartition if leader is ahead of controller (apache#12506)
  KAFKA-13986; Brokers should include node.id in fetches to metadata quorum (apache#12498)
  KAFKA-14163; Retry compilation after zinc compile cache error (apache#12507)
  Remove duplicate common.message.* from clients:test jar file (apache#12407)
  KAFKA-13060: Replace EasyMock and PowerMock with Mockito in WorkerGroupMemberTest.java (apache#12484)
  Fix the rate window size calculation for edge cases (apache#12184)
  MINOR: Upgrade gradle to 7.5.1 and bump other build/test dependencies (apache#12495)
  KAFKA-14140: Ensure an offline or in-controlled-shutdown replica is not eligible to join ISR in ZK mode (apache#12487)
  KAFKA-14114: Add Metadata Error Related Metrics
  MINOR: BrokerMetadataSnapshotter must avoid exceeding batch size (apache#12486)
  MINOR: Upgrade mockito test dependencies (apache#12460)
  KAFKA-14144:; Compare AlterPartition LeaderAndIsr before fencing partition epoch (apache#12489)
  KAFKA-14134: Replace EasyMock with Mockito for WorkerConnectorTest (apache#12472)
  MINOR: Update scala version in bin scripts to 2.13.8 (apache#12477)
  KAFKA-14104; Add CRC validation when iterating over Metadata Log Records (apache#12457)
  MINOR: add :server-common test dependency to :storage (apache#12488)
  KAFKA-14107: Upgrade Jetty version for CVE fixes (apache#12440)
  KAFKA-14124: improve quorum controller fault handling (apache#12447)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Kafka Broker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants