Commit 40933d2
authored
Check for broker existence when forming partition replica and ISR lists (#776)
Data for each partition returned by Conn.ReadPartitions includes the
list of replicas and the ISR for the partition. The broker data is
copied from the list of currently available brokers, retrieved from
Kafka metadata. It can happen that a broker is not present in metadata
(due to being down, for example), but still listed as a replica for a
partition. (For example, broker 2 may be down but the ID 2 can still be
listed as a replica for a partition.)
The logic that copies broker data from the list of available brokers
into partition data now omits any that are not present in the metadata
list. Without this change, partition data receives the copy of a nil
object in its replica or ISR list (ID 0, host nil, default port 9092),
which is useless.1 parent df0521c commit 40933d2
2 files changed
+46
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
994 | 994 | | |
995 | 995 | | |
996 | 996 | | |
997 | | - | |
998 | | - | |
999 | | - | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
1004 | | - | |
1005 | 997 | | |
1006 | 998 | | |
1007 | 999 | | |
| |||
1013 | 1005 | | |
1014 | 1006 | | |
1015 | 1007 | | |
1016 | | - | |
1017 | | - | |
| 1008 | + | |
| 1009 | + | |
1018 | 1010 | | |
1019 | 1011 | | |
1020 | 1012 | | |
| |||
1025 | 1017 | | |
1026 | 1018 | | |
1027 | 1019 | | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
1028 | 1030 | | |
1029 | 1031 | | |
1030 | 1032 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1322 | 1322 | | |
1323 | 1323 | | |
1324 | 1324 | | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
0 commit comments