Commit Graph

13582 Commits

Author SHA1 Message Date
Stig Døssing fe5802b304
KAFKA-17722 Fix "this-escape" compiler warnings (BrokerTopicMetrics) … (#19308)
Cherry picked from commit a880c846ae

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-04-07 00:48:37 +08:00
Ayoub Omari a78491af79 KAFKA-16407: Fix foreign key INNER join on change of FK from/to a null value (#19303)
Fixes both KAFKA-16407 and KAFKA-16434.

Summary of existing issues:

- We are ignoring new left record when its previous FK value is null
- We do not unset foreign key join result when FK becomes null

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-04-05 21:26:28 -07:00
Stig Døssing fb9aa10677
MINOR: Update Mockito on 3.9 for Java 23 support (#19367)
This was done on trunk in 6a37d5cceb

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-04-04 23:47:00 +08:00
Stig Døssing d3fa770c58
MINOR: Backport Gradle upgrades to 3.9 (#19365)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-04-04 23:40:16 +08:00
nilmadhab mondal d37f884035 KAFKA-18713: Fix FK Left-Join result race condition (#19005)
When a row in a FK-join left table is updated, we should send a "delete
subscription with no response" for the old FK to the right hand side, to
avoid getting two responses from the right hand side. Only the "new
subscription" for the new FK should request a response. If two responses
are requested, there is a race condition for which both responses could
be processed in the wrong order, leading to an incorrect join result.

This PR fixes the "delete subscription" case accordingly, to no request
a response.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-04-03 17:23:01 -07:00
Jorge Esteban Quilcate Otoya c37ac21cc9
KAFKA-15931: Cancel RemoteLogReader gracefully (#19150)
Backports f24945b519 to 3.9

Instead of reopening the transaction index, it cancels the RemoteFetchTask without interrupting it--avoiding to close the TransactionIndex channel.

This will lead to complete the execution of the remote fetch but ignoring the results. Given that this is considered a rare case, we could live with this. If it becomes a performance issue, it could be optimized.

Reviewers: Jun Rao <junrao@gmail.com>
2025-04-01 14:10:12 -07:00
Matthias J. Sax 4b86ff9d00
KAFKA-18943: Update EosIntegrationTest for EOSv1 (#19312)
After cherry-picking
2181ddbb03,
we realized that the newly added test does not cover EOSv1. This PR closes this testing gap.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-03-31 10:56:58 -07:00
Matthias J. Sax 90ee2d2b34 KAFKA-18943: Kafka Streams incorrectly commits TX during task revokation (#19164)
Fixes two issues:
 - only commit TX if no revoked tasks need to be committed
 - commit revoked tasks after punctuation triggered

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, Anna Sophie Blee-Goldman <sophie@responsive.dev>, Bruno Cadonna <bruno@confluent.io>, Bill Bejeck <bill@confluent.io>
2025-03-13 11:28:26 -07:00
David Jacot bf9912a1eb KAFKA-18046; High CPU usage when using Log4j2 (#19138)
This patch is a first step towards resolving KAFKA-18046. Apache Kafka
4.0 ships with log4j2 so the issue raised in the ticket causing high CPU
usage on the fetch path due to LoggerFactory.getLogger() being called on
the handling of all fetch responses is not good. Hence, I propose to fix
that one by caching the Logger used by the `CompletedFetch` class.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Ismael Juma <ismael@juma.me.uk>
2025-03-07 09:08:04 +01:00
Matthias J. Sax d23107e71f MINOR: reduce per-batch logging to TRACE level (#19101)
Logging on a per-batch bases is very chatty, and should only be done at
TRACE level to avoid spamming DEBUG logs.

Reviewers: Justine Olshan <jolshan@confluent.io>, Lucas Brutschy <lbrutschy@confluent.io>
2025-03-06 14:37:19 -08:00
PoAn Yang 1ec1043d51
KAFKA-18844 Stale features information in QuorumController#registerBroker (#19058)
In #16848, we added `kraft.version` to finalized features and got finalized features outside controller event handling thread. This may make finalized features stale when processing `registerBroker` event. Also, some cases like `QuorumControllerTest.testBalancePartitionLeaders` become flaky cause of outdated MV. This PR moves finalized features back to controller event handling thread to avoid the error.

Reviewers: Ismael Juma <ijuma@apache.org>, Jun Rao <junrao@gmail.com>, Colin P. McCabe <cmccabe@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-04 15:42:51 +08:00
PoAn Yang 4d0216dd9f KAFKA-18281: Kafka is improperly validating non-advertised listeners for routable controller addresses (#18387)
When a cluster is configured with a dynamic controller quorum, KRaft replica's endpoint are computed using the advertised.listeners property and not the quorum.controller.voters property. This change in the configuration makes it difficult to keeping all previous node configurations compatible with the new endpoint discovery functionality.

The least intrusive solution is to rely on Kafka's reverse hostname lookup when the hostname is not specified. The effective advertised controller listener now remove '0.0.0.0' hostname if the endpoint came from the listener configuration and not the advertised.listener configuration.

Reviewers: José Armando García Sancio <jsancio@apache.org>, Alyssa Huang <ahuang@confluent.io>
2025-02-24 20:12:44 -07:00
Ismael Juma 9142740cb3 MINOR: Remove request log space added inadvertently (#19011)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-02-23 13:47:03 -08:00
Luke Chen 66e2ac0e09
MINOR: add docs for "org.apache.kafka.sasl.oauthbearer.allowed.urls" in v3.9 (#18940)
add docs for "org.apache.kafka.sasl.oauthbearer.allowed.urls" in v3.9.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2025-02-18 17:13:09 +08:00
Matthias J. Sax b7481ba89b HOTFIX: StoreChangelogReader should require stable consumer group (#18901)
Fixing regression bug, introduced by beac86f049

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Bruno Cadonna <bruno@confluent.io>
2025-02-17 22:24:12 -08:00
Jhen-Yung Hsu 0c288599c5 KAFKA-18803 The acls would appear at the wrong level of the metadata shell "tree" (#18916)
Reviewers: David Arthur <mumrah@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-02-17 03:57:41 +08:00
Edoardo Comar c455c10405 KAFKA-18758: NullPointerException in shutdown following InvalidConfigurationException (#18833)
Add checks for null in shutdown as BrokerLifecycleManager is not instantiaited if LogManager constructor throws an Exception
2025-02-11 10:51:23 +00:00
PoAn Yang 27a3e5560e
KAFKA-806 Index may not always observe log.index.interval.bytes (#18843)
Currently, each log.append() will add at most 1 index entry, even when the appended data is larger than log.index.interval.bytes. One potential issue is that if a follower restarts after being down for a long time, it may fetch data much bigger than log.index.interval.bytes at a time. This means that fewer index entries are created, which can increase the fetch time from the consumers.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Jun Rao <junrao@gmail.com>
2025-02-11 01:24:19 +08:00
Ming-Yen Chung c215b8b645
KAFKA-18675 Add unit test to verify space separated brokers won't cause exception for 3.8 and 3.9 (#18767)
Reviewers: Ken Huang <s7133700@gmail.com>, TengYao Chi <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-02-05 16:55:10 +08:00
PoAn Yang 6b2f2aa2f1 KAFKA-18028 the effective kraft version of --no-initial-controllers should be 1 rather than 0 (#17836)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-02-04 09:29:28 -08:00
Justin Lee 8831f5b133 KAFKA-18001: Support UpdateRaftVoterRequest in KafkaNetworkChannel (#17773)
Adds support for UpdateRaftVoterRequest in KafkaNetworkChannel. This addresses the following scenario:

* Bootstrap a KRaft Controller quorum in dynamic mode
* Start additional controllers (as observers)
* Update kraft.version feature from 0 to 1
* Use kafka-metadata-quorum add-controller to promote an observer controller to a follower

Reviewers: Colin Patrick McCabe <cmccabe@apache.org>, Alyssa Huang <ahuang@confluent.io>
2025-02-03 17:05:15 -08:00
Chung, Ming-Yen 5a074a60df
KAFKA-18171: Revert the strict config validation for 3.8 and 3.9 (#18741)
* Revert "KAFKA-16946: Utils.getHost/getPort cannot parse SASL_PLAINTEXT://host:port (#16319)"

This reverts commit 09bc5be63e.

* Revert "KAFKA-16824: Utils.getHost and Utils.getPort do not catch a lot of invalid host and ports. (#16048)"

This reverts commit 0971924ebc.

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-01-29 22:18:29 +00:00
Ismael Juma 6b82a4cc6a
KAFKA-18663: Metadata v0-v3 should be undeprecated (#18736)
See KAFKA-18648 for details.

Reviewers: David Arthur <mumrah@gmail.com>
2025-01-29 06:38:24 -08:00
Logan Zhu 85658e5e33
KAFKA-18597 Fix max-buffer-utilization-percent is always 0 (#18690)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-28 02:23:59 +08:00
Martin Sillence 00f851f44d KAFKA-17792: Efficiently parse decimals with large exponents in Connect Values (#17510)
Reviewers: Greg Harris <greg.harris@aiven.io>, Mickael Maison <mickael.maison@gmail.com>
2025-01-27 10:09:40 -08:00
Dimitar Dimitrov a92022f7f6
KAFKA-18583; Fix getPartitionReplicaEndpoints for KRaft (#18657)
The cherry-pick required reimplementing the accompanying test to work
with UpdateMetadataRequest (removed in 4.0 and trunk) in order to also
apply to `ZkMetadataCache`. If the removal of UpdateMetadataRequest is
backported here as well, the test can be changed to match the trunk
version.

Reviewers: David Jacot <djacot@confluent.io>
2025-01-22 00:39:18 -08:00
Matthias J. Sax 9f64ef255b KAFKA-17402: DefaultStateUpdated should transite task atomically (#18607)
Reviewers: Bruno Cadonna <bruno@confluent.io>, Lucas Brutschy <lbrutschy@confluent.io>
2025-01-21 12:50:01 -08:00
Matthias J. Sax 379049fd4c KAFKA-8862: Improve Producer error message for failed metadata update (#18587)
We should provide the same informative error message for both timeout
cases.

Reviewers: Kirk True <ktrue@confluent.io>, Andrew Schofield <aschofield@confluent.io>, Ismael Juma <ismael@juma.me.uk>
2025-01-21 08:47:20 -08:00
Alieh Saeedi 310867a984
Cherrypick lock backoff retry to 3.9 (#18485)
This PR cherry-picks the commits of this and this PR to 3.9.
The above-listed two PRs aim at implementing exponential back off retry for state directory lock to increase the time between two consecutive attempts of acquiring the lock.

Reviewer: Bruno Cadonna <cadonna@apache.org>
2025-01-21 10:14:28 +01:00
Luke Chen 35829fddcb
MINOR: Cleanups in ConfigurationUtils (#18576)
Some clean up for ConfigurationUtils for v3.x.

Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-01-20 20:31:26 +08:00
Bruno Cadonna 9c33e7d3d9 HOTFIX: Replace List.of with Arrays.asList
Cherry-pick of e7a7efd introduces a compilation error
due to the use of List.of.
2025-01-16 16:35:37 +01:00
Bruno Cadonna e7a7efd602 KAFKA-18546: Use mocks instead of a real DNS lookup to the outside (#18565)
Since the example.com DNS lookup changed the second time within one
year, we rewrote the unit tests for ClientUtils so that they do
not make a real DNS lookup to the outside but use mocks.

Reviewers: PoAn Yang <payang@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>, Lianet Magrans <lmagrans@confluent.io>
2025-01-16 16:26:41 +01:00
Mickael Maison 4038edfafe MINOR: Cleanups in JaasUtils (#18522)
Reviewers: Luke Chen <showuon@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-16 14:33:32 +01:00
Mickael Maison cebba1772b MINOR: Adjust logging in SerializedJwt (#18523)
Reviewers: Luke Chen <showuon@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-16 11:19:01 +01:00
Matthias J. Sax 84f9ad6f40 KAFKA-18479: RocksDBTimeOrderedKeyValueBuffer not initialized correctly (#18490)
RocksDBTimeOrderedKeyValueBuffer is not initialize with serdes provides
via Joined, but always uses serdes from StreamsConfig.

Reviewers: Bill Bejeck <bill@confluent.io>
2025-01-15 10:57:40 -08:00
Matthias J. Sax 155d77204e HOTIFX: fix broken build
List.of is not supported in Java8.
2025-01-15 10:32:47 -08:00
PoAn Yang ad51d9bfb3 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:46:21 +01:00
TengYao Chi bb0921865d KAFKA-18330: Update documentation to remove controller deployment limitations (#18281)
Reviewers: José Armando García Sancio <jsancio@apache.org>
2025-01-14 16:34:29 -05:00
Matthias J. Sax 323c37584b MINOR: fix KafkaStreams archtype docs (#18469)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-13 11:22:19 -08:00
Hailey Ni 5c5bfdc70c KAFKA-17973: Relax Restriction for Voters Set Change (#17728)
Relax the voter set change validation that exists in KRaft. When reading the kraft partition and validating voter set changes allow the voter set to have more than one change.

This violates the invariant that after a voter change there are overlapping voters for all possible majorities. This is okay because the KRaft leader checks that there are no pending voter set updates when handling an add voter request and a remove voter request.

Reviewers: José Armando García Sancio <jsancio@apache.org>
2025-01-13 12:13:39 -05:00
Matthias J. Sax ed83f7224d 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:35:58 -08:00
Almog Gavra 5b353044a0 MINOR: improve StreamThread periodic processing log (#18430)
The current log is really helpful, this PR adds a bit more information to that log to help debug some issues. In particular, it is interesting to be able to debug situations that have long intervals between polls. It also includes a reference to how long it has been since it last logged so you don't have to find the previous time it was logged to compute quick per-second ratios.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2025-01-09 11:17:21 -08:00
Colt McNealy b1112a4616 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:44:30 -08:00
Almog Gavra 4956d5e2e3 KAFKA-18326: fix merge iterator with cache tombstones (#18287)
See https://issues.apache.org/jira/browse/KAFKA-18326 for more information. The main bug here is that in the old implementation, deleted cache entries would be skipped so long as they didn't equal the next store key, which resulted in potentially skipping tombstones for future keys in the store.

Reviewers: Guozhang Wang <guozhang.wang.us@gmail.com>, Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2025-01-07 23:06:34 -08:00
Ismael Juma 22a9127fe1
KAFKA-18272: Deprecated protocol api usage should be logged at info level (3.9) (#18333)
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.

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.

The cherry-pick from trunk had one conflict: `RequestConvertToJson` was rewritten from Scala to Java in trunk. In addition, I added an upgrade note for 3.9.1.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-28 09:12:19 -08:00
Ismael Juma ba14b5ca78
KAFKA-18352: DeleteGroups v0 incorrectly tagged as deprecated (3.9) (#18323)
The Sarama version listed in the KIP only supports v0.
2024-12-26 17:23:34 -08:00
PoAn Yang f5952c6f6a
MINOR: fix TopicCommand warning message.format.version output (#18311)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2024-12-25 18:20:23 +08:00
Jhen-Yung Hsu 430892654b KAFKA-18342 Use `File.exist` instead of `File.exists` to ensure the `Vagrantfile` works with Ruby 3.2+ (#18306)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-24 15:05:31 +08:00
Ismael Juma 77246d1b69 KAFKA-18334: Produce v4-v6 should be undeprecated (#18288)
Librdkafka totally breaks if produce v3 is removed - it starts sending records with record format v0.
These api versions have to be undeprecated - KIP-896 has been updated.

Reviewers: David Arthur <mumrah@gmail.com>
2024-12-20 17:41:17 -08:00
Ismael Juma 1e6fe5e7dd KAFKA-18270: FindCoordinator v0 incorrectly tagged as deprecated (#18262)
It's now consistent with KIP-896.
2024-12-20 17:40:25 -08:00