18
18
from ducktape .mark .resource import cluster
19
19
from ducktape .tests .test import Test
20
20
from ducktape .utils .util import wait_until
21
- from kafkatest .services .kafka import KafkaService
21
+ from kafkatest .services .kafka import KafkaService , quorum
22
22
from kafkatest .services .streams import StreamsBrokerCompatibilityService
23
23
from kafkatest .services .verifiable_consumer import VerifiableConsumer
24
- from kafkatest .services .zookeeper import ZookeeperService
25
- from kafkatest .version import LATEST_0_11_0 , LATEST_0_10_2 , LATEST_0_10_1 , LATEST_0_10_0 , LATEST_1_0 , LATEST_1_1 , \
26
- LATEST_2_0 , LATEST_2_1 , LATEST_2_2 , LATEST_2_3 , LATEST_2_4 , LATEST_2_5 , LATEST_2_6 , LATEST_2_7 , LATEST_2_8 , \
24
+ from kafkatest .version import LATEST_2_8 , \
27
25
LATEST_3_0 , LATEST_3_1 , LATEST_3_2 , LATEST_3_3 , LATEST_3_4 , LATEST_3_5 , LATEST_3_6 , LATEST_3_7 , LATEST_3_8 , KafkaVersion
28
26
29
27
30
28
class StreamsBrokerCompatibility (Test ):
31
29
"""
32
30
These tests validates that
33
- - Streams works for older brokers 0.11 (or newer)
34
- - Streams w/ EOS-alpha works for older brokers 0.11 (or newer)
35
31
- Streams w/ EOS-v2 works for older brokers 2.5 (or newer)
36
- - Streams fails fast for older brokers 0.10.0, 0.10.2, and 0.10.1
37
- - Streams w/ EOS-v2 fails fast for older brokers 2.4 or older
38
32
"""
39
33
40
34
input = "brokerCompatibilitySourceTopic"
41
35
output = "brokerCompatibilitySinkTopic"
42
36
43
37
def __init__ (self , test_context ):
44
38
super (StreamsBrokerCompatibility , self ).__init__ (test_context = test_context )
45
- self .zk = ZookeeperService (test_context , num_nodes = 1 )
46
39
self .kafka = KafkaService (test_context ,
47
40
num_nodes = 1 ,
48
- zk = self . zk ,
41
+ zk = None ,
49
42
topics = {
50
43
self .input : {'partitions' : 1 , 'replication-factor' : 1 },
51
44
self .output : {'partitions' : 1 , 'replication-factor' : 1 }
@@ -60,18 +53,15 @@ def __init__(self, test_context):
60
53
self .output ,
61
54
"stream-broker-compatibility-verify-consumer" )
62
55
63
- def setUp (self ):
64
- self .zk .start ()
65
-
66
56
67
57
@cluster (num_nodes = 4 )
68
- @matrix (broker_version = [str (LATEST_0_11_0 ),str (LATEST_1_0 ),str (LATEST_1_1 ),str (LATEST_2_0 ),
69
- str (LATEST_2_1 ),str (LATEST_2_2 ),str (LATEST_2_3 ),str (LATEST_2_4 ),
70
- str (LATEST_2_5 ),str (LATEST_2_6 ),str (LATEST_2_7 ),str (LATEST_2_8 ),
58
+ @matrix (broker_version = [str (LATEST_2_8 ),
71
59
str (LATEST_3_0 ),str (LATEST_3_1 ),str (LATEST_3_2 ),str (LATEST_3_3 ),
72
60
str (LATEST_3_4 ),str (LATEST_3_5 ),str (LATEST_3_6 ),str (LATEST_3_7 ),
73
- str (LATEST_3_8 )])
74
- def test_compatible_brokers_eos_disabled (self , broker_version ):
61
+ str (LATEST_3_8 )],
62
+ metadata_quorum = [quorum .combined_kraft ]
63
+ )
64
+ def test_compatible_brokers_eos_disabled (self , broker_version , metadata_quorum ):
75
65
self .kafka .set_version (KafkaVersion (broker_version ))
76
66
self .kafka .start ()
77
67
@@ -88,11 +78,12 @@ def test_compatible_brokers_eos_disabled(self, broker_version):
88
78
self .kafka .stop ()
89
79
90
80
@cluster (num_nodes = 4 )
91
- @matrix (broker_version = [str (LATEST_2_5 ), str ( LATEST_2_6 ), str ( LATEST_2_7 ), str ( LATEST_2_8 ),
81
+ @matrix (broker_version = [str (LATEST_2_8 ),
92
82
str (LATEST_3_0 ),str (LATEST_3_1 ),str (LATEST_3_2 ),str (LATEST_3_3 ),
93
83
str (LATEST_3_4 ),str (LATEST_3_5 ),str (LATEST_3_6 ),str (LATEST_3_7 ),
94
- str (LATEST_3_8 )])
95
- def test_compatible_brokers_eos_v2_enabled (self , broker_version ):
84
+ str (LATEST_3_8 )],
85
+ metadata_quorum = [quorum .combined_kraft ])
86
+ def test_compatible_brokers_eos_v2_enabled (self , broker_version , metadata_quorum ):
96
87
self .kafka .set_version (KafkaVersion (broker_version ))
97
88
self .kafka .start ()
98
89
@@ -107,48 +98,3 @@ def test_compatible_brokers_eos_v2_enabled(self, broker_version):
107
98
108
99
self .consumer .stop ()
109
100
self .kafka .stop ()
110
-
111
- @cluster (num_nodes = 4 )
112
- @parametrize (broker_version = str (LATEST_0_10_2 ))
113
- @parametrize (broker_version = str (LATEST_0_10_1 ))
114
- @parametrize (broker_version = str (LATEST_0_10_0 ))
115
- def test_fail_fast_on_incompatible_brokers (self , broker_version ):
116
- self .kafka .set_version (KafkaVersion (broker_version ))
117
- self .kafka .start ()
118
-
119
- processor = StreamsBrokerCompatibilityService (self .test_context , self .kafka , "at_least_once" )
120
-
121
- with processor .node .account .monitor_log (processor .STDERR_FILE ) as monitor :
122
- processor .start ()
123
- monitor .wait_until ('FATAL: An unexpected exception org.apache.kafka.common.errors.UnsupportedVersionException' ,
124
- timeout_sec = 60 ,
125
- err_msg = "Never saw 'FATAL: An unexpected exception org.apache.kafka.common.errors.UnsupportedVersionException " + str (processor .node .account ))
126
-
127
- self .kafka .stop ()
128
-
129
- @cluster (num_nodes = 4 )
130
- @parametrize (broker_version = str (LATEST_2_4 ))
131
- @parametrize (broker_version = str (LATEST_2_3 ))
132
- @parametrize (broker_version = str (LATEST_2_2 ))
133
- @parametrize (broker_version = str (LATEST_2_1 ))
134
- @parametrize (broker_version = str (LATEST_2_0 ))
135
- @parametrize (broker_version = str (LATEST_1_1 ))
136
- @parametrize (broker_version = str (LATEST_1_0 ))
137
- @parametrize (broker_version = str (LATEST_0_11_0 ))
138
- def test_fail_fast_on_incompatible_brokers_if_eos_v2_enabled (self , broker_version ):
139
- self .kafka .set_version (KafkaVersion (broker_version ))
140
- self .kafka .start ()
141
-
142
- processor = StreamsBrokerCompatibilityService (self .test_context , self .kafka , "exactly_once_v2" )
143
-
144
- with processor .node .account .monitor_log (processor .STDERR_FILE ) as monitor :
145
- with processor .node .account .monitor_log (processor .LOG_FILE ) as log :
146
- processor .start ()
147
- log .wait_until ('Shutting down because the Kafka cluster seems to be on a too old version. Setting processing\.guarantee="exactly_once_v2" requires broker version 2\.5 or higher\.' ,
148
- timeout_sec = 60 ,
149
- err_msg = "Never saw 'Shutting down because the Kafka cluster seems to be on a too old version. Setting `processing.guarantee=\" exactly_once_v2\" ` requires broker version 2.5 or higher.' log message " + str (processor .node .account ))
150
- monitor .wait_until ('FATAL: An unexpected exception org.apache.kafka.common.errors.UnsupportedVersionException' ,
151
- timeout_sec = 60 ,
152
- err_msg = "Never saw 'FATAL: An unexpected exception org.apache.kafka.common.errors.UnsupportedVersionException' error message " + str (processor .node .account ))
153
-
154
- self .kafka .stop ()
0 commit comments