Skip to content

KAFKA-12321 the comparison function for uuid type should be 'equals' …#10098

Merged
chia7712 merged 1 commit intoapache:trunkfrom
chia7712:KAFKA-12321
Feb 12, 2021
Merged

KAFKA-12321 the comparison function for uuid type should be 'equals' …#10098
chia7712 merged 1 commit intoapache:trunkfrom
chia7712:KAFKA-12321

Conversation

@chia7712
Copy link
Copy Markdown
Member

issue: https://issues.apache.org/jira/browse/KAFKA-12321

current comparison

if (this.taggedUuid != Uuid.fromString("H3KKO4NTRPaCWtEmm3vW7A"))

fixed comparison

if (!this.taggedUuid.equals(Uuid.fromString("H3KKO4NTRPaCWtEmm3vW7A")))

Committer Checklist (excluded from commit message)

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

@chia7712 chia7712 requested review from cmccabe and vvcephei February 10, 2021 15:56
Copy link
Copy Markdown
Member

@ijuma ijuma left a comment

Choose a reason for hiding this comment

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

Good catch, LGTM assuming the question below is true. We should also backport it to older branches.

@Test
public void defaultValueShouldBeWritable() {
for (short version = SimpleExampleMessageData.LOWEST_SUPPORTED_VERSION; version <= SimpleExampleMessageData.HIGHEST_SUPPORTED_VERSION; ++version) {
MessageUtil.toByteBuffer(new SimpleExampleMessageData(), version);
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 fails without the change in this PR?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This fails without the change in this PR?

yep. The generated code is shown below.

            if (this.taggedUuid != Uuid.fromString("H3KKO4NTRPaCWtEmm3vW7A")) {
                throw new UnsupportedVersionException("Attempted to write a non-default taggedUuid at version " + _version);
            }

@chia7712 chia7712 merged commit 2294d10 into apache:trunk Feb 12, 2021
chia7712 added a commit that referenced this pull request Feb 12, 2021
…rather than '==' (#10098)

Reviewers: Ismael Juma <ismael@juma.me.uk>
chia7712 added a commit that referenced this pull request Feb 12, 2021
…rather than '==' (#10098)

Reviewers: Ismael Juma <ismael@juma.me.uk>
chia7712 added a commit that referenced this pull request Feb 12, 2021
…rather than '==' (#10098)

Reviewers: Ismael Juma <ismael@juma.me.uk>
@chia7712
Copy link
Copy Markdown
Member Author

push to trunk, 2.8, 2.7 and 2.6

ijuma added a commit to ijuma/kafka that referenced this pull request Feb 14, 2021
…e-allocations-lz4

* apache-github/trunk: (118 commits)
  KAFKA-12327: Remove MethodHandle usage in CompressionType (apache#10123)
KAFKA-12297: Make MockProducer return RecordMetadata with values as
per contract
  MINOR: Update zstd and use classes with no finalizers (apache#10120)
KAFKA-12326: Corrected regresion in MirrorMaker 2 executable
introduced with KAFKA-10021 (apache#10122)
KAFKA-12321 the comparison function for uuid type should be 'equals'
rather than '==' (apache#10098)
  MINOR: Add FetchSnapshot API doc in KafkaRaftClient (apache#10097)
  MINOR: KIP-631 KafkaConfig fixes and improvements (apache#10114)
  KAFKA-12272: Fix commit-interval metrics (apache#10102)
  MINOR: Improve confusing admin client shutdown logging (apache#10107)
  MINOR: Add BrokerMetadataListener (apache#10111)
  MINOR: Support Raft-based metadata quorums in system tests (apache#10093)
MINOR: add the MetaLogListener, LocalLogManager, and Controller
interface. (apache#10106)
  MINOR: Introduce the KIP-500 Broker lifecycle manager (apache#10095)
MINOR: Remove always-passing validation in
TestRecordTest#testProducerRecord (apache#9930)
KAFKA-5235: GetOffsetShell: Support for multiple topics and consumer
configuration override (KIP-635) (apache#9430)
MINOR: Prevent creating partition.metadata until ID can be written
(apache#10041)
  MINOR: Add RaftReplicaManager (apache#10069)
MINOR: Add ClientQuotaMetadataManager for processing QuotaRecord
(apache#10101)
  MINOR: Rename DecommissionBrokers to UnregisterBrokers (apache#10084)
MINOR: KafkaBroker.brokerState should be volatile instead of
AtomicReference (apache#10080)
  ...

clients/src/main/java/org/apache/kafka/common/record/CompressionType.java
core/src/test/scala/unit/kafka/coordinator/group/GroupMetadataManagerTest.scala
@chia7712 chia7712 deleted the KAFKA-12321 branch March 25, 2024 15:21
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