Skip to content

KAFKA-18561: Remove withKip853Rpc and replace it with withRaftProtocol #18600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 41 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d101ea5
KAFKA-18561: Remove withKip853Rpc and replace with withRaftProtocol
frankvicky Jan 17, 2025
c9654ad
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 2, 2025
2103297
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 4, 2025
b78d546
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 6, 2025
e8eb829
replace isSupport853 with isReconfiguredSupport
frankvicky Mar 6, 2025
6a903f2
address by comments
frankvicky Mar 6, 2025
495dd18
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 8, 2025
0aca46f
address by comments
frankvicky Mar 8, 2025
8a7221f
extract RaftProtocol as a single file and revert some static import
frankvicky Mar 12, 2025
a200b78
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 12, 2025
6085ab7
apply spotless and enable all raft protocol for KafkaRaftClientTest
frankvicky Mar 12, 2025
f7a73ca
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 13, 2025
e733329
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 15, 2025
1f04317
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 16, 2025
4ce8e63
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 17, 2025
1aff727
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 20, 2025
9a65529
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 21, 2025
c383570
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 22, 2025
efc2b18
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 23, 2025
41562b0
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 24, 2025
6c28109
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 25, 2025
2c34597
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 26, 2025
23825e0
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 27, 2025
90bcc3e
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 29, 2025
f8899ae
Merge branch 'trunk' into KAFKA-18561
frankvicky Mar 30, 2025
5138e1b
Merge branch 'trunk' into KAFKA-18561
frankvicky Apr 1, 2025
04951ad
Merge branch 'trunk' into KAFKA-18561
frankvicky Apr 3, 2025
b6a7e47
fix conflicts
frankvicky Apr 3, 2025
5b5d856
Merge branch 'trunk' into KAFKA-18561
frankvicky Apr 5, 2025
b274ff7
Merge branch 'trunk' into KAFKA-18561
frankvicky Apr 6, 2025
29b8f81
Merge branch 'trunk' into KAFKA-18561
frankvicky Apr 7, 2025
0b5c992
Merge branch 'trunk' into KAFKA-18561
frankvicky Apr 9, 2025
52a4d57
Merge branch 'trunk' into KAFKA-18561
frankvicky Apr 10, 2025
70ab047
Merge branch 'trunk' into KAFKA-18561
frankvicky Apr 12, 2025
abfb9a9
Merge branch 'trunk' into KAFKA-18561
frankvicky Apr 15, 2025
38ee31e
Merge branch 'trunk' into KAFKA-18561
frankvicky Apr 16, 2025
e48acee
Merge branch 'trunk' into KAFKA-18561
frankvicky Apr 17, 2025
c5c7117
Merge branch 'trunk' into KAFKA-18561
frankvicky Apr 18, 2025
7f95aa1
fix conflicts
frankvicky Apr 18, 2025
8f6088b
Merge branch 'trunk' into KAFKA-18561
frankvicky Apr 20, 2025
0d6185e
Merge branch 'trunk' into KAFKA-18561
frankvicky Apr 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
public class KafkaRaftClientClusterAuthTest {
@ParameterizedTest
@ValueSource(booleans = { true, false })
void testClusterAuthorizationFailedInFetch(boolean withKip853Rpc) throws Exception {
void testClusterAuthorizationFailedInFetch(boolean isReconfigSupported) throws Exception {
int localId = randomReplicaId();
int otherNodeId = localId + 1;
int epoch = 5;
Set<Integer> voters = Set.of(localId, otherNodeId);

RaftClientTestContext context = new RaftClientTestContext.Builder(localId, voters)
.withKip853Rpc(withKip853Rpc)
.withRaftProtocol(isReconfigSupported ? RaftProtocol.KIP_853_PROTOCOL : RaftProtocol.KIP_595_PROTOCOL)
.withElectedLeader(epoch, otherNodeId)
.build();

Expand All @@ -66,7 +66,7 @@ void testClusterAuthorizationFailedInFetch(boolean withKip853Rpc) throws Excepti

@ParameterizedTest
@ValueSource(booleans = { true, false })
void testClusterAuthorizationFailedInBeginQuorumEpoch(boolean withKip853Rpc) throws Exception {
void testClusterAuthorizationFailedInBeginQuorumEpoch(boolean isReconfigSupported) throws Exception {
int localId = randomReplicaId();
int otherNodeId = localId + 1;
int epoch = 5;
Expand All @@ -75,7 +75,7 @@ void testClusterAuthorizationFailedInBeginQuorumEpoch(boolean withKip853Rpc) thr
RaftClientTestContext context = new RaftClientTestContext.Builder(localId, voters)
.updateRandom(r -> r.mockNextInt(DEFAULT_ELECTION_TIMEOUT_MS, 0))
.withUnknownLeader(epoch - 1)
.withKip853Rpc(withKip853Rpc)
.withRaftProtocol(isReconfigSupported ? RaftProtocol.KIP_853_PROTOCOL : RaftProtocol.KIP_595_PROTOCOL)
.build();

context.time.sleep(context.electionTimeoutMs());
Expand All @@ -96,15 +96,15 @@ void testClusterAuthorizationFailedInBeginQuorumEpoch(boolean withKip853Rpc) thr

@ParameterizedTest
@ValueSource(booleans = { true, false })
void testClusterAuthorizationFailedInVote(boolean withKip853Rpc) throws Exception {
void testClusterAuthorizationFailedInVote(boolean isReconfigSupported) throws Exception {
int localId = randomReplicaId();
int otherNodeId = localId + 1;
int epoch = 5;
Set<Integer> voters = Set.of(localId, otherNodeId);

RaftClientTestContext context = new RaftClientTestContext.Builder(localId, voters)
.withUnknownLeader(epoch - 1)
.withKip853Rpc(withKip853Rpc)
.withRaftProtocol(isReconfigSupported ? RaftProtocol.KIP_853_PROTOCOL : RaftProtocol.KIP_595_PROTOCOL)
.build();

// Become a candidate
Expand All @@ -122,14 +122,14 @@ void testClusterAuthorizationFailedInVote(boolean withKip853Rpc) throws Exceptio

@ParameterizedTest
@ValueSource(booleans = { true, false })
void testClusterAuthorizationFailedInEndQuorumEpoch(boolean withKip853Rpc) throws Exception {
void testClusterAuthorizationFailedInEndQuorumEpoch(boolean isReconfigSupported) throws Exception {
int localId = randomReplicaId();
int otherNodeId = localId + 1;
Set<Integer> voters = Set.of(localId, otherNodeId);

RaftClientTestContext context = new RaftClientTestContext.Builder(localId, voters)
.withUnknownLeader(1)
.withKip853Rpc(withKip853Rpc)
.withRaftProtocol(isReconfigSupported ? RaftProtocol.KIP_853_PROTOCOL : RaftProtocol.KIP_595_PROTOCOL)
.build();

context.unattachedToLeader();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private static void testFetchResponseWithInvalidRecord(MemoryRecords records, in
VoterSetTest.voterSet(Stream.of(local, electedLeader)), KRaftVersion.KRAFT_VERSION_1
)
.withElectedLeader(epoch, electedLeader.id())
.withRaftProtocol(RaftClientTestContext.RaftProtocol.KIP_996_PROTOCOL)
.withRaftProtocol(RaftProtocol.KIP_996_PROTOCOL)
.build();

context.pollUntilRequest();
Expand Down Expand Up @@ -102,7 +102,7 @@ void testReplicationOfHigherPartitionLeaderEpoch() throws Exception {
VoterSetTest.voterSet(Stream.of(local, electedLeader)), KRaftVersion.KRAFT_VERSION_1
)
.withElectedLeader(epoch, electedLeader.id())
.withRaftProtocol(RaftClientTestContext.RaftProtocol.KIP_996_PROTOCOL)
.withRaftProtocol(RaftProtocol.KIP_996_PROTOCOL)
.build();

context.pollUntilRequest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.apache.kafka.common.protocol.ApiKeys;
import org.apache.kafka.common.protocol.Errors;
import org.apache.kafka.common.record.MemoryRecords;
import org.apache.kafka.raft.RaftClientTestContext.RaftProtocol;
import org.apache.kafka.server.common.KRaftVersion;

import org.junit.jupiter.params.ParameterizedTest;
Expand All @@ -35,7 +34,7 @@

import static org.apache.kafka.raft.KafkaRaftClientTest.randomReplicaId;
import static org.apache.kafka.raft.KafkaRaftClientTest.replicaKey;
import static org.apache.kafka.raft.RaftClientTestContext.RaftProtocol.KIP_996_PROTOCOL;
import static org.apache.kafka.raft.RaftProtocol.KIP_996_PROTOCOL;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

Expand Down
Loading