Skip to content

KAFKA-1543: Changing replication factor#161

Closed
apakulov wants to merge 1 commit into
apache:trunkfrom
apakulov:KAFKA-1543
Closed

KAFKA-1543: Changing replication factor#161
apakulov wants to merge 1 commit into
apache:trunkfrom
apakulov:KAFKA-1543

Conversation

@apakulov

Copy link
Copy Markdown
Contributor

Adding support to change replication-factor via kafka-topics to avoid additional hassle of defining replicas explicilty. This change will allow to make this change with one line:

kafka-topics.sh --zookeeper host:port --alter --topic name --replication-factor 3

Also, made a small cleanup by replacing old junit.framework.Assert with org.junit.Assert

@apakulov apakulov changed the title KAFKA-1543; Changing replication factor KAFKA-1543: Changing replication factor Aug 22, 2015
@asfbot

asfbot commented Aug 22, 2015

Copy link
Copy Markdown

kafka-trunk-git-pr #195 FAILURE
Looks like there's a problem with this pull request

@asfbot

asfbot commented Aug 22, 2015

Copy link
Copy Markdown

kafka-trunk-git-pr #196 FAILURE
Looks like there's a problem with this pull request

@resetius

Copy link
Copy Markdown
Contributor

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.

This will cause the partition to be randomly redistributed and might cause unnecessary data move. Maybe we should specify the fixedStartIndex.

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.

Good point, I'll make a change to avoid doing that.

@ebn-critter

Copy link
Copy Markdown

Was this ever resolved? Would definitely be a nice feature to be added.

@leifg

leifg commented Jun 15, 2016

Copy link
Copy Markdown

👍

@llamahunter

Copy link
Copy Markdown

I think that changing replication factor is probably something that ought to be done with a bit more transparency than what you get with the kafka-topics.sh command. I've augmented kafka-reassign-partitions.sh to take an extra, optional 'replication-factor' param for each topic having partition reassignment. You can review the proposed partition reassignment with the new replication factor applied before executing it. See #1596

@guozhangwang

Copy link
Copy Markdown
Contributor

@apakulov Would you like to continue working on this PR?

@asfbot

asfbot commented Dec 21, 2016

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/322/
Test FAILed (JDK 8 and Scala 2.12).

@asfbot

asfbot commented Dec 21, 2016

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/321/
Test FAILed (JDK 7 and Scala 2.10).

@asfbot

asfbot commented Dec 21, 2016

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/323/
Test FAILed (JDK 8 and Scala 2.11).

@pono pono closed this Dec 26, 2016
dguy added a commit to dguy/kafka that referenced this pull request Apr 13, 2017
@qwinkler

qwinkler commented Feb 4, 2020

Copy link
Copy Markdown
$ kafka-topics --alter --topic my-topic --replication-factor 3
Option "[replication-factor]" can't be used with option "[alter]"

There are some tools that may be used to achieve this, but it will be great to have this out-of-box.

@holmofy

holmofy commented May 12, 2021

Copy link
Copy Markdown

Excuse me, is this feature supported now?

davide-armand pushed a commit to aiven/kafka that referenced this pull request Dec 1, 2025
…apache#161)

Some control-plane tests expecting 2 partitions for t1 but only one was created.

[INK-105]
fvaleri pushed a commit to fvaleri/kafka that referenced this pull request May 14, 2026
gaurav-narula added a commit to gaurav-narula/kafka that referenced this pull request Jul 20, 2026
This reverts commit 55efc8d, reversing
changes made to 1c8b6d3.
fvaleri pushed a commit to fvaleri/kafka that referenced this pull request Jul 21, 2026
…e#228)

* Revert "Merge pull request apache#161 from showuon/cl3_ut"

This reverts commit 55efc8d, reversing
changes made to 1c8b6d3.

* Revert "Merge pull request apache#155 from showuon/cl3_share_auto_create"

This reverts commit 05f8874, reversing
changes made to 143e6cc.

* MINOR: Cleanups in Tools Module (3/n) (apache#20332)

This PR aims at cleaning up the tools module further by getting rid of
some extra code which can be replaced by `record`

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>

* MINOR: kafka-stream-groups.sh should fail quickly if the partition leader is unavailable (apache#20271)

This PR applies the same partition leader check for `StreamsGroupCommand` as
`ShareGroupCommand`  and `ConsumerGroupCommand` to avoid the command
execution timeout.

Reviewers: Lucas Brutschy <lucasbru@apache.org>

* KAFKA-19662: Allow resetting offset for unsubscribed topic in kafka-share-groups.sh (apache#20453)

The `kafka-share-groups.sh` tool checks whether a topic already has a
start-offset in the share group when resetting offsets. This is not
necessary. By removing the check, it is possible to set a start offset
for a topic which has not yet but will be subscribed in the future, thus
initialising the consumption point.

There is still a small piece of outstanding work to do with resetting
the offset for a non-existent group which should also create the group.
A subsequent PR will be used to address that.

Reviewers: Jimmy Wang <48462172+JimmyWang6@users.noreply.github.com>,
Lan Ding <isDing_L@163.com>, Apoorv Mittal <apoorvmittal10@gmail.com>

* KAFKA-19662: Reset share group offsets for unsubscribed topics (apache#20708)

This PR allows the kafka-share-groups.sh --reset-offsets tool to be used
to set offsets for topics which are not currently subscribed in a share
group. It also works if the share group does not yet exist. This brings
the capability in line with the equivalent function in
Kafka-consumer-groups.sh. The primary purpose is to allow offsets to be
set before the share group is first used as a way of initialising in a
known state.

Reviewers: Jimmy Wang <48462172+JimmyWang6@users.noreply.github.com>,
 Kuan-Po Tseng <brandboat@gmail.com>, Apoorv Mittal
 <apoorvmittal10@gmail.com>

---------

Co-authored-by: Sanskar Jhajharia <sjhajharia@confluent.io>
Co-authored-by: jimmy <wangzhiwang611@gmail.com>
Co-authored-by: Andrew Schofield <aschofield@confluent.io>
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.