Skip to content

KAFKA-2945: CreateTopic - protocol and server side implementation#1489

Closed
granthenke wants to merge 5 commits into
apache:trunkfrom
granthenke:create-wire-new
Closed

KAFKA-2945: CreateTopic - protocol and server side implementation#1489
granthenke wants to merge 5 commits into
apache:trunkfrom
granthenke:create-wire-new

Conversation

@granthenke

Copy link
Copy Markdown
Member

No description provided.

@granthenke

Copy link
Copy Markdown
Member Author

This pull request supersedes #626.

I opened a new pull request in order to reduce confusion based on old/outdated discussion.
All reviews from that pull request were taken into consideration here.
Thank you to @guozhangwang, @gwenshap, @ijuma, @hachikuji, and @junrao for reviews on that PR.

For the latest discussion on this KIP change please see the Kafka dev. mailing list.

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.

To have the right concurrency semantics, you should not mutate the map after assigning it to the final field.

@granthenke
granthenke force-pushed the create-wire-new branch 5 times, most recently from b631126 to 04c2e43 Compare June 20, 2016 19:53
@granthenke

Copy link
Copy Markdown
Member Author

Pinging for review now that the vote has passed.
@ijuma @junrao @gwenshap @guozhangwang @ewencp

new NotControllerException("This is not the correct controller for this cluster.")),
INVALID_REQUEST(42,
new InvalidRequestException("This most likely occurs because of a request being malformed by the client library or" +
" the message was sent to an incompatible broker. See the broker logs for more details."));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since we haven't deprecated ErrorMapping, could we add those new error codes as place holders in ErrorMapping?

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.

I will add it.

Note: That since only a newer client (the admin client) can actually make a request that causes this error, it should never show up in the old scala clients.

@granthenke granthenke Jul 7, 2016

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.

Looking closer at ErrorMapping there are many codes left out that would never be used. Do these fall under that category? Are you sure I should add them?

For now I will add the comment like the others:

// 35: UNSUPPORTED_VERSION
// 36: TOPIC_ALREADY_EXISTS
// 37: INVALID_PARTITIONS
// 38: INVALID_REPLICATION_FACTOR
// 39: INVALID_REPLICA_ASSIGNMENT
// 40: INVALID_CONFIG
// 41: NOT_CONTROLLER
// 42: INVALID_REQUEST

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, we just want to prevent someone from accidentally adding the same error code for a different exception in ErrorMapping in the future.

@granthenke

Copy link
Copy Markdown
Member Author

@junrao I updated the patch to address your reviews.

@granthenke

Copy link
Copy Markdown
Member Author

@junrao Will you have a chance to review further? Any more changes needed?

val zkUtils: ZkUtils) extends Logging with KafkaMetricsGroup {
this.logIdent = "[Admin Manager on Broker " + config.brokerId + "]: "

val topicPurgatory = DelayedOperationPurgatory[DelayedOperation]("topic", config.brokerId)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"topic" seems to be an ambiguous name for this purgatory. If we expect this purgatory to be specific to topic creation, this probably should be createTopic. If we expect this to be generic to all admin tasks, this probably should be admin.

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.

The key for this purgatory is the topic name. Items tracked in this purgatory will all try to be completed when topic metadata is changed. This will included the delete topic requests and alter topic requests. In that sense I think topicPurgatory makes sense.

I didn't call it admin purgatory since admin requests for ACLs or configs won't leverage this purgatory.

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