Commit Graph

3554 Commits

Author SHA1 Message Date
Sushant Mahajan 47f22faac3
MINOR: Added flaky references for a few tests. (#18558)
Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-01-15 19:24:52 +00:00
Kuan-Po Tseng d3b4c1bdf4
KAFKA-18401: Transaction version 2 does not support commit transaction without records (#18448)
Fix the issue where producer.commitTransaction under transaction version 2 throws error if no partition or offset is added to transaction. The solution is to avoid sending the endTxnRequest unless producer.send or producer.sendOffsetsToTransaction is triggered.

Reviewers: Justine Olshan <jolshan@confluent.io>
2025-01-15 10:21:11 -08:00
PoAn Yang 85d2e90074
HOTFIX: ClientUtilsTest#testParseAndValidateAddressesWithReverseLookup (#18549)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Gaurav Narula <gaurav_narula2@apple.com>, TengYao Chi <kitingiao@gmail.com>
2025-01-15 16:09:03 +01:00
Mickael Maison 66b1f00c0e
KAFKA-18520: Remove ZooKeeper logic from JaasUtils (#18530)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-15 13:17:06 +01:00
Mickael Maison 6b8cc5d558
MINOR: Remove ZooKeeper mentions in Admin javadoc (#18531)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-15 10:33:30 +01:00
Ismael Juma f3a93551fa
Revert "KAFKA-18034: CommitRequestManager should fail pending requests on fatal coordinator errors (#18050)" (#18544)
This reverts commit 70d6312a3a.

Reviewers: Luke Chen <showuon@gmail.com>
2025-01-15 16:16:47 +08:00
Pramithas Dhakal ea77352dfc
Rename the variable to reflect its purpose (#18525)
Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-01-14 18:00:27 +00:00
Sanskar Jhajharia e3e4c17959
Add DescribeShareGroupOffsets API [KIP-932] (#18500)
Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Andrew Schofield <aschofield@confluent.io>
2025-01-14 14:33:39 +00:00
Istvan Toth d7e5d0a59b
KAFKA-18064: SASL mechanisms should throw exception on wrap/unwrap (#17901)
SASL mechanisms that do support neither integrity nor confidentality should throw exception on wrap/unwrap.

The current implementation does not implement wrap/unwrap correctly.
This may cause security issues, if the code using the mechanisms does
not check for QOP correctly.

Reviewers: Gaurav Narula <gaurav_narula2@apple.com>, Igor Soarez <i@soarez.me>
2025-01-14 11:30:01 +00:00
陳昱霖(Yu-Lin Chen) 4fcde4542b
KAFKA-18469;KAFKA-18036: AsyncConsumer should request metadata update if ListOffsetRequest encounters a retriable error (#18475)
Reviewers: Lianet Magrans <lmagrans@confluent.io>
2025-01-13 19:03:52 +01:00
Ken Huang 70d6312a3a
KAFKA-18034: CommitRequestManager should fail pending requests on fatal coordinator errors (#18050)
Reviewers: Kirk True <ktrue@confluent.io>, Lianet Magrans <lmagrans@confluent.io>
2025-01-13 15:29:14 +01:00
Xuan-Zhang Gong dbe27c9eb2
KAFKA-18467 enhance the docs of `NewTopic` - the first replica will be treated as the preferred leader (#18470)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-12 20:32:13 +08:00
Ismael Juma d4aee71e36
KAFKA-18465: Remove MetadataVersions older than 3.0-IV1 (#18468)
Apache Kafka 4.0 will only support KRaft and 3.0-IV1 is the minimum version supported by KRaft. So, we can assume that Apache Kafka 4.0 will only communicate with brokers that are 3.0-IV1 or newer.

Note that KRaft was only marked as production-ready in 3.3, so we could go further and set the baseline to 3.3. I think we should have that discussion, but it made sense to start with the non controversial parts.

Reviewers: Jun Rao <junrao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>, David Jacot <david.jacot@gmail.com>
2025-01-11 09:42:39 -08:00
Matthias J. Sax f54cfff1dc
MINOR: simplify producer TX abort error handling (#18486)
Reviewers: Justine Olshan <jolshan@confluent.io>, Jason Gustafson <jason@responsive.dev>
2025-01-10 17:54:40 -08:00
Matthias J. Sax 3b38b016c8
KAFKA-17825: Update docs for ByteBufferDeserializer changes in 3.6 release (#18466)
KIP-863 introduced a change to ByteBufferDeserializer which is not
properly documented, but should be called out because it could surface
bugs in application code which using ByteBufferDeserializer.

Reviewers:  Lianet Magrans <lmagrans@confluent.io>, Kirk True <ktrue@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-10 15:32:51 -08:00
PoAn Yang 2b7c039971
KAFKA-18440: Convert AuthorizationException to fatal error in AdminClient (#18435)
Reviewers: Divij Vaidya <diviv@amazon.com>
2025-01-10 11:12:28 +01:00
Colt McNealy bb22eec478
KAFKA-17455: fix stuck producer when throttling or retrying (#17527)
A producer might get stuck after it was throttled. This PR unblocks the producer by polling again
after pollDelayMs in NetworkUtils#awaitReady().

Reviewers: Matthias J. Sax <matthias@confluent.io>, David Jacot <djacot@confluent.io>
2025-01-09 10:27:04 -08:00
Ismael Juma cf7029c026
KAFKA-13093: Log compaction should write new segments with record version v2 (KIP-724) (#18321)
Convert v0/v1 record batches to v2 during compaction even if said record batches would be
written with no change otherwise. A few important details:

1. V0 compressed record batch with multiple records is converted into single V2 record batch
2. V0 uncompressed records are converted into single record V2 record batches
3. V0 records are converted to V2 records with timestampType set to `CreateTime` and the
timestamp is `-1`.
4. The `KAFKA-4298` workaround is no longer needed since the conversion to V2 fixes
the issue too.
5. Removed a log warning applicable to consumers older than 0.10.1 - they are no longer
supported.
6. Added back the ability to append records with v0/v1 (for testing only).
7. The creation of the leader epoch cache is no longer optional since the record version
config is effectively always V2.

Add integration tests, these tests existed before #18267 - restored, modified and
extended them.

Reviewers: Jun Rao <jun@confluent.io>
2025-01-09 09:37:23 -08:00
xijiu fcd98da9ae
KAFKA-18445 Remove LazyDownConversionRecords and LazyDownConversionRecordsSend (#18445)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-10 00:22:56 +08:00
Ken Huang 64b8b4a632
MINOR: Remove ZooKeeper mentions in Sanitizer (#18420)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-01-09 14:33:43 +01:00
Andrew Schofield 3f9d2c2db0
KAFKA-18433: Add BatchSize to ShareFetch request (1/N) (#18439)
Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>
2025-01-08 15:29:43 +00:00
ShivsundarR 3c7ed3333d
KAFKA-18397: Added null check before sending background event from ShareConsumeRequestManager. (#18419)
Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-01-08 13:56:52 +00:00
Lianet Magrans 0721d21a57
KAFKA-18415: Fix for event queue metric and flaky test (#18416)
Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-01-08 14:31:10 +01:00
Peter Lee 08ef22d888
KAFKA-18173 Remove duplicate `assertFutureError` (#18296)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-08 20:24:35 +08:00
Manikumar Reddy 746ab4dc1e MINOR: Few cleanups 2025-01-08 16:01:40 +05:30
Guang 058f0a94c8
MINOR: Replace deprecated MemberDescription calls in test (#18425)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-08 17:32:21 +08:00
mingdaoy c40cc5740f
KAFKA-18408 tweak the 'tag' field for BrokerHeartbeatRequest.json, BrokerRegistrationChangeRecord.json and RegisterBrokerRecord.json (#18421)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-08 04:16:59 +08:00
TengYao Chi abeed20168
KAFKA-10790: Add deadlock detection to producer#flush (#17946)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Andrew Schofield <aschofield@confluent.io>, TaiJuWu <tjwu1217@gmail.com>
2025-01-07 16:32:43 +00:00
David Jacot f974b3dcd4
MINOR: Fix typo in CommitRequestManager (#18407)
This patch fix a minor typo in CommitRequestManager.

Reviewers: Kamal Chandraprakash <kamal.chandraprakash@gmail.com>
2025-01-07 12:59:59 +01:00
Matthias J. Sax 738bd928f1
MINOR: cleanup JavaDocs for deprecation warnings (#18402)
Reviewers: Bill Bejeck <bbejeck@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-07 09:18:33 +00:00
Matthias J. Sax 3918f37af1
MINOR: Update Consumer and Producer JavaDocs for committing offsets (#18336)
The consumer/producer JavaDocs still contain instruction for naively
computing the offset to be committed.

This PR updates the JavaDocs with regard to the improvements of KIP-1094.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>, Lianet Magrans <lmagrans@confluent.io>
2025-01-06 13:39:20 -08:00
Andrew Schofield 53a8b6189a
KAFKA-17539: Application metrics extension for share consumer (#18377)
Reviewers: Christo Lolov <lolovc@amazon.com>, Apoorv Mittal <apoorvmittal10@gmail.com>
2025-01-06 15:06:38 +00:00
Ismael Juma 409a43eff7
MINOR: Collection/Option usage simplification via methods introduced in Java 9 & 11 (#18305)
Relevant methods:
1. `List.of`, `Set.of`, `Map.of` and similar (introduced in Java 9)
2. Optional: `isEmpty` (introduced in Java 11), `stream` (introduced in Java 9).

Reviewers: Mickael Maison <mimaison@users.noreply.github.com>
2025-01-03 16:13:39 -08:00
Ismael Juma 73ab7ee4ea
MINOR: Use `Files.readString/writeString` and `String.repeat` to simplify code (#18372)
The 3 methods were introduced in Java 11.

Reviewers: Divij Vaidya <diviv@amazon.com>
2025-01-02 17:50:27 -08:00
Andrew Schofield 0344f8f5ae
KAFKA-18273: KIP-1099 verbose display share group options (#18259)
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2025-01-02 09:12:52 +00:00
Ismael Juma 083e344b30
MINOR: Remove PureJavaCrc32C and reflective code for CRC32C (#18361)
This is no longer required since we dropped support for Java 8. Also update `NOTICE*` and
`spotbugs-exclude.xml` files.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Arthur <mumrah@gmail.com>
2025-01-01 02:08:06 -08:00
Apoorv Mittal f88cf57e1c
KAFKA-12469: Deprecated and corrected topic metrics for consumer (KIP-1109) (#18232)
The PR implements the behaviour defined in KIP-1109. It corrects the consumer topic and topic-partition metrics, while deprecating the incorrect ones.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Jun Rao <junrao@gmail.com>, Andrew Schofield <aschofield@confluent.io>
2024-12-31 17:35:47 +00:00
TengYao Chi 96527be90d
KAFKA-18243 Fix compatibility of Loggers class between log4j and log4j2 (#18185)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-30 01:50:52 +08:00
Ismael Juma 3654bc4513
KAFKA-18339: Fix parseRequestHeader error handling (#18340)
A minor refactoring just before merging #18295 introduced a regression and no test failed. Throw the correct exception and add test to verify it. Also refactor the code slightly to make that possible.

Thanks to Chia-Ping for catching the issue.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-29 09:31:14 -08:00
Dongnuo Lyu e47f6983df
MINOR: Replace enum name with state name when parsing `ConsumerGroupState` (#18315)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-29 23:11:55 +08:00
Ken Huang 106fd5f601
KAFKA-18354 Use log4j2 APIs to refactor LogCaptureAppender (#18338)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-29 22:50:53 +08:00
Peter Lee be4d1a6277
KAFKA-18135: ShareConsumer HB UnsupportedVersion msg mixed with Consumer HB (#18101)
Add specific error handling for unsupported version in share consumer and consumer

Reviewers: Lianet Magrans <lmagrans@confluent.io>, Andrew Schofield <aschofield@confluent.io>
2024-12-28 15:39:58 +00:00
PoAn Yang e67172ce6d
MINOR: remove zkBroker from StreamsGroupHeartbeatRequest and StreamsGroupDescribeRequest (#18319)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-28 16:58:29 +08:00
mingdaoy d95cb7d65e
MINOR: remove unused previousPartition from RoundRobinPartitioner.java (#18331)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-28 16:33:32 +08:00
Ismael Juma 875da35ec3
KAFKA-18339: Remove raw unversioned direct SASL protocol (KIP-896) (#18295)
Clients that support SASL but don't implement KIP-43 (eg Kafka producer/consumer 0.9.0.x) will
fail to connect after this change.

Added unit tests and also manually tested with the console producer 0.9.0.

While testing, I noticed that the logged message when a 0.9.0 Java client is used without sasl is
slightly misleading - fixed that too.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2024-12-27 10:23:25 -08:00
PoAn Yang e6d2421136
KAFKA-18295 Remove deprecated function Partitioner#onNewBatch (#18282)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-27 18:40:19 +08:00
Ismael Juma dfb178a1d8
KAFKA-18272: Deprecated protocol api usage should be logged at info level (#18313)
This makes it possible to enable request logs for deprecated protocol api versions without enabling it for the rest. Combined with the ability to enable/disable dynamically, it makes it a bit easier to collect the information about deprecated clients that is not available via metrics.

This isn't particularly useful in trunk/4.0 since there are no deprecated api versions in these versions, but it will be useful for older branches. I intend to backport to those branches and add a release note in the backport regarding the change in behavior.

I manually verified that:
1. If the request logger is configured at `INFO` level, only deprecated protocol api versions are logged and they are logged at `INFO` level.
2. If the request logger is configured at `DEBUG` level, all requests are logged but the log level is `INFO` for deprecated protocol api versions and `DEBUG` for the rest.
3. If the request logger is configured at `WARN` level (the default), no requests are logged.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-27 00:04:19 -08:00
xijiu 6139840e98
KAFKA-18348 Remove the deprecated MockConsumer#setException (#18317)
Reviewers: TengYao Chi <kitingiao@gmail.com>, TaiJuWu <tjwu1217@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-12-27 12:31:23 +08:00
Ismael Juma 2e3b4cb957
KAFKA-18352: Add back DeleteGroups v0, it incorrectly tagged as deprecated (#18324)
The Sarama version listed in the KIP only supports v0.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-26 16:53:50 -08:00
Chung, Ming-Yen 88adb94c81
KAFKA-18093 Remove deprecated DeleteTopicsResult#values (#18250)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-25 14:46:14 +08:00