Commit Graph

11741 Commits

Author SHA1 Message Date
Gantigmaa Selenge f970ddff10
KAFKA-15210: Mention vote should be open for at atleast 72 hours in the release script (#14183)
Reviewers: Divij Vaidya <diviv@amazon.com>
2023-08-16 13:00:39 +02:00
Christo Lolov d0e9e94629
KAFKA-14133: Migrate ActiveTaskCreatorTest, ChangelogTopicsTest and GlobalProcessorContextImplTest to Mockito (#14209)
Reviewers: Divij Vaidya <diviv@amazon.com>
2023-08-16 10:19:35 +02:00
bachmanity1 cfe49d1b77
KAFKA-7438: Replace EasyMock with Mockito in SessionStoreBuilderTest (#14142)
Reviewers: Divij Vaidya <diviv@amazon.com>, Yash Mayya <yash.mayya@gmail.com>
2023-08-16 10:01:49 +02:00
Christo Lolov 1a15cd708a
KAFKA-14133: Migrato SessionCacheFlushListenerTest, TimestampedCacheFlushListenerTest and TimestampedTupleForwarderTest to Mockito (#14205)
Reviewers: Divij Vaidya <diviv@amazon.com>
2023-08-16 09:46:40 +02:00
vamossagar12 ee27773549
KAFKA-15329: Make default remote.log.metadata.manager.class.name as topic based RLMM (#14202)
As described in the KIP here the default value of remote.log.metadata.manager.class.name should be TopicBasedRemoteLogMetadataManager

Reviewers: Luke Chen <showuon@gmail.com>, Kamal Chandraprakash <kchandraprakash@uber.com>, Divij Vaidya <diviv@amazon.com>
2023-08-16 09:46:17 +08:00
Omnia G.H Ibrahim 35e925f353
KAFKA-15102: Add replication.policy.internal.topic.separator.enabled property to MirrorMaker 2 (KIP-949) (#14082)
Reviewers: Chris Egerton <chrise@aiven.io>
2023-08-15 19:58:52 -04:00
Philip Nee b97e8203eb
MINOR: CommitRequestManager should only poll when the coordinator node is known (#14179)
As title, we discovered a flaky bug during testing that the commit request manager would seldomly throw a NOT_COORDINATOR exception, which means the request was routed to a non-coordinator node. We discovered that if we don't check the coordinator node in the commitRequestManager, the request manager will pass on an empty node to the NetworkClientDelegate, which implies the request can be sent to any node in the cluster. This behavior is incorrect as the commit requests need to be routed to a coordinator node.

Because the timing coordinator's discovery during integration testing isn't entirely deterministic; therefore, the test became extremely flaky. After fixing this: The coordinator node is mandatory before attempt to enqueue these commit request to the NetworkClient.

Reviewers: Jun Rao <junrao@gmail.com>
2023-08-15 15:01:28 -07:00
Greg Harris 28858f3a3e
MINOR: Fix SynchronizationTest classloaders sometimes not being parallel capable (#14177)
Reviewers: Chris Egerton <chrise@aiven.io>
2023-08-15 14:24:48 -07:00
Greg Harris 1a001c1e88
KAFKA-15336: Add ServiceLoader Javadocs for Connect plugins (#14194)
Reviewers: Chris Egerton <chrise@aiven.io>
2023-08-15 13:21:45 -07:00
David Arthur 0a531b7e7c
MINOR: Install ControllerServer metadata publishers sooner (#14215)
This patch is a follow up of #14169 that installs the metadata publishers before blocking on the authorizer future.

Reviewers: Colin P. McCabe <cmccabe@apache.org>
2023-08-15 13:01:31 -07:00
David Arthur c199840f0a MINOR: Fix the ZkMigrationState metric in KafkaController
This patch fixes an issue for ZK controllers where we were emitting the ZkMigrationState enum
rather than a value. This can lead to downstream failures with JMX metrics since the RMI protocol
will marshal the ZkMigrationState object returned by the gauge. Any downstream consumer of this
metric (like jconsole or a metrics exporter) will not be able to unmarshal the value since the
ZkMigrationState class will not be present.

The fix is simply to emit the byte value of this enum.

Reviewers: Colin P. McCabe <cmccabe@apache.org>, Alok Thatikunta <athatikunta@confluent.io>
2023-08-15 12:29:59 -07:00
Kamal Chandraprakash 696a56dd2b
KAFKA-15295: Add config validation when remote storage is enabled on a topic (#14176)
Add config validation which verifies that system level remote storage is enabled when enabling remote storage for a topic. In case verification fails, it throws InvalidConfigurationException.

Reviewers: Christo Lolov <lolovc@amazon.com>, Divij Vaidya <diviv@amazon.com>,  Luke Chen <showuon@gmail.com>
2023-08-15 20:43:11 +02:00
bachmanity1 fd6c9f16ba
KAFKA-7438: Replace Easymock & Powermock with Mockito in RocksDBMetricsRecorderGaugesTest (#14190)
Reviewers: Christo Lolov <christololov@gmail.com>, Divij Vaidya <diviv@amazon.com>
2023-08-15 11:48:13 +02:00
Colin Patrick McCabe adc16d0f31
KAFKA-14538: Implement KRaft metadata transactions in QuorumController
Implement the QuorumController side of KRaft metadata transactions.

As specified in KIP-868, this PR creates a new metadata version, IBP_3_6_IV1, which contains the
three new records: AbortTransactionRecord, BeginTransactionRecord, EndTransactionRecord.

In order to make offset management unit-testable, this PR moves it out of QuorumController.java and
into OffsetControlManager.java. The general approach here is to track the "last stable offset," which is
calculated by looking at the latest committed offset and the in-progress transaction (if any). When
a transaction is aborted, we revert back to this last stable offset. We also revert back to it when
the controller is transitioning from active to inactive.

In a follow-up PR, we will add support for the transaction records in MetadataLoader. We will also
add support for automatically aborting pending transactions after a controller failover.

Reviewers: David Arthur <mumrah@gmail.com>
2023-08-14 16:58:56 -07:00
Calvin Liu 5a67b080c7
MINOR: Fix a race when query isUnderMinIsr (#14138)
When the leader becomes the follower, we first remove the ISR and then reset the leader. If we call isUnderMinIsr in between, we will get an answer with true which is a race bug.

Reviewers: Justine Olshan <jolshan@confluent.io>
2023-08-14 16:14:29 -07:00
Kirk True 67b527460e
KAFKA-14937: Refactoring for client code to reduce boilerplate (#13990)
Move common code from the client implementations to the ClientUtils
class or (consumer) Utils class, where passible.

There are a number of places in the client code where the same basic
calls are made by more than one client implementation. Minor
refactoring will reduce the amount of boilerplate code necessary for
the client to construct its internal state.


Reviewers: Lianet Magrans <lianetmr@gmail.com>, Jun Rao <junrao@gmail.com>
2023-08-14 10:08:20 -07:00
Lucas Brutschy 5234ddff50
KAFKA-15326: [5/N] Processing thread punctuation (#14001)
Implements punctuation inside processing threads. The scheduler
algorithm checks if a task that is not assigned currently can
be punctuated, and returns it when a worker thread asks for the
next task to be processed. Then, the processing thread runs all
punctuations in the punctionation queue.

Piggy-backed: take TaskExecutionMetadata into account when
processing records.

Reviewer: Bruno Cadonna <cadonna@apache.org>
2023-08-14 17:17:28 +02:00
vveicc 43751d8d05
KAFKA-15289: Support KRaft mode in RequestQuotaTest (#14201)
Enable kraft mode for RequestQuotaTest, there are 2 works left to be done.

Reviewers: dengziming <dengziming1993@gmail.com>
2023-08-14 17:04:15 +08:00
Chris Egerton d91c9bd2b5
KAFKA-14682: Report Mockito unused stubbings during Jenkins build (#14186)
* KAFKA-14682: Report Mockito unused stubbings during Jenkins build

* DO NOT MERGE: Add test case that should fail during Jenkins build

* Revert "DO NOT MERGE: Add test case that should fail during Jenkins build"

This reverts commit 8418b835ec.
2023-08-12 16:52:49 -04:00
bachmanity1 ae46c0a34c
KAFKA-7438: Replace Easymock & Powermock with Mockito in TableSourceNodeTest (#14189)
Reviewers: Divij Vaidya <diviv@amazon.com>
2023-08-12 10:41:07 +02:00
Hao Li 3a94670a01
MINOR: Fix streams task assignor tests (#14196)
Reviewers: Divij Vaidya <diviv@amazon.com>
2023-08-12 10:38:07 +02:00
Rittika Adhikari cfb45b0001
MINOR: Refactor TierStateMachine related tests into a separate test file (#13503)
This PR builds off of KAFKA-14685 and refactors any tests explicitly related to ReplicaFetcherTierStateMachine into a separate testing file ReplicaFetcherTierStateMachineTest.

Reviewers: Jun Rao <junrao@gmail.com>
2023-08-11 14:15:17 -07:00
Philip Nee f6b8b39747
MINOR: Fix committed API in the PrototypeAsyncConsumer timeout (#14123)
Discovered the committed() API timeout during the integration test. After investigation, this is because the future was not completed in the ApplicationEventProcessor. Also added toString methods to the event class for debug purposes.

Reviewers: Jun Rao <junrao@gmail.com>
2023-08-11 13:15:30 -07:00
Greg Harris f5655d31d3
KAFKA-15030: Add connect-plugin-path command-line tool (#14064)
Reviewers: Chris Egerton <chrise@aiven.io>
2023-08-11 12:05:51 -07:00
Florin Akermann 1e747a24a3
KAFKA-13197: fix GlobalKTable join/left-join semantics documentation. (#14187)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2023-08-11 11:45:18 -07:00
Hao Li 4268e502ec
KAFKA-15022: [10/N] docs for rack aware assignor (#14181)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2023-08-11 11:40:33 -07:00
Nikolay 1fd58e30cf
KAFKA-14595: Move classes from ReassignPartitionsCommand to tools (#14172)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2023-08-11 14:52:14 +02:00
bachmanity1 f137da04fa
KAFKA-14132: Replace Easymock & Powermock with Mockito in KafkaBasedLogTest (#14153)
Reviewers: Yash Mayya <yash.mayya@gmail.com>, Divij Vaidya <diviv@amazon.com>
2023-08-11 10:50:37 +02:00
Luke Chen cdbc9a8d88
KAFKA-15083: add config with "remote.log.metadata" prefix (#14151)
When configuring RLMM, the configs passed into configure method is the RemoteLogManagerConfig. But in RemoteLogManagerConfig, there's no configs related to remote.log.metadata.*, ex: remote.log.metadata.topic.replication.factor. So, even if users have set the config in broker, it'll never be applied.

This PR fixed the issue to allow users setting RLMM prefix: remote.log.metadata.manager.impl.prefix (default is rlmm.config.), and then, appending the desired remote.log.metadata.* configs, it'll pass into RLMM, including remote.log.metadata.common.client./remote.log.metadata.producer./ remote.log.metadata.consumer. prefixes.

Ex:

# default value
# remote.log.storage.manager.impl.prefix=rsm.config.
# remote.log.metadata.manager.impl.prefix=rlmm.config.

rlmm.config.remote.log.metadata.topic.num.partitions=50
rlmm.config.remote.log.metadata.topic.replication.factor=4

rsm.config.test=value

Reviewers: Christo Lolov <christololov@gmail.com>, Kamal Chandraprakash <kchandraprakash@uber.com>, Divij Vaidya <diviv@amazon.com>
2023-08-11 10:42:14 +08:00
Federico Valeri 111df859f0
MINOR: Add comment to onPartitionsLost override (#14121)
This adds comments to the ConsumerRebalanceListener overrides, in order to briefly explain why we are overriding these methods, when they are called, and what you can or can't do. Especially onPartitionsLost can create some confusion given the default implementation.

Reviewers: Luke Chen <showuon@gmail.com>, David Jacot <djacot@confluent.io>
2023-08-11 10:34:55 +08:00
vveicc 594156e01b
KAFKA-15287: Change NodeApiVersions.create() to support both zk and kraft (#14185)
Reviewers: dengziming <dengziming1993@gmail.com>
2023-08-11 10:18:13 +08:00
Greg Harris ab60bce090
KAFKA-15239: Fix ThroughputThrottler import-control (#14188)
Reviewers: Chris Egerton <chrise@aiven.io>
2023-08-10 16:53:49 -07:00
Greg Harris 821954e569
KAFKA-15233: Add documentation for plugin.discovery and connect-plugin-path (KIP-898) (#14068)
Reviewers: Qichao Chu (@ex172000), Chris Egerton <chrise@aiven.io>
2023-08-10 16:16:11 -07:00
Federico Valeri 8de3e0436a
KAFKA-15239: Fix system tests using producer performance service (#14092)
Reviewers: Greg Harris <greg.harris@aiven.io>
2023-08-10 14:23:43 -07:00
Yash Mayya f2ebd333e8
KAFKA-13187: Replace EasyMock / PowerMock with Mockito in DistributedHerderTest (#14102)
Reviewers: Chris Egerton <chrise@aiven.io>
2023-08-10 16:47:30 -04:00
Greg Harris 0ee26640e5
KAFKA-15202: Fix MM2 offset translation when syncs are variably spaced (#14156)
Reviewers: Chris Egerton <chrise@aiven.io>
2023-08-10 13:25:50 -07:00
David Mao b35ee39eda
KAFKA-15220: Do not returned fenced brokers from getAliveBrokerNode (#14050)
getAliveBrokerNode returns fenced brokers as alive which is inconsistent with methods like
getAliveBrokerNodes. Add a filter to not return fenced brokers and adds a test to validate that
the two functions are consistent.

Reviewers: Colin P. McCabe <cmccabe@apache.org>
2023-08-10 11:06:12 -07:00
aindriu-aiven db34f8b9a1
KAFKA-15291: Connect plugins should declare a version (#14159)
Signed-off-by: Aindriu Lavelle <aindriu.lavelle@aiven.io>
Reviewers: Andrew Schofield, Greg Harris <greg.harris@aiven.io>
2023-08-10 10:45:12 -07:00
Colin Patrick McCabe 9318b591d7
KAFKA-15318: Update the Authorizer via AclPublisher (#14169)
On the controller, move publishing acls to the Authorizer into a dedicated MetadataPublisher,
AclPublisher. This publisher listens for notifications from MetadataLoader, and receives only
committed data. This brings the controller side in line with how the broker has always worked. It
also avoids some ugly code related to publishing directly from the QuorumController. Most important
of all, it clears the way to implement metadata transactions without worrying about Authorizer
state (since it will be handled by the MetadataLoader, along with other metadata image state).

In AclsDelta, we can remove isSnapshotDelta. We always know when the MetadataLoader is giving us a
snapshot. Also bring AclsDelta in line with the other delta classes, where completeSnapshot
calculates the diff between the previous image and the next one. We don't use this delta (since we
just apply the image directly to the authorizer) but we should have it, for consistency.

Finally, change MockAclMutator to avoid the need to subclass AclControlManager.

Reviewers: David Arthur <mumrah@gmail.com>
2023-08-09 23:54:46 -07:00
vveicc 393b563bb5
KAFKA-15288: Change BrokerApiVersionsCommandTest to support kraft mode (#14175)
Use ApiKeys.clientApis() to replace ApiKeys.zkBrokerApis() to support kraft mode.

Reviewers: dengziming <dengziming1993@gmail.com>
2023-08-10 14:26:37 +08:00
Hao Li 96631c25d5
KAFKA-15022: [9/N] use RackAwareTaskAssignor in StickyTaskAssignor (#14178)
Part of KIP-925.

Use rack aware assignor in StickyTaskAssignor.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2023-08-09 19:50:43 -07:00
Qichao Chu c72065a632
MINOR: Add test for describe topic with ID (#14110)
* MINOR: Add test for describe topic with ID

Add a simple test to verify topic description with topic IDs.

Reviewers: Divij Vaidya <diviv@amazon.com>, dengziming <dengziming1993@gmail.com>
2023-08-10 10:16:30 +08:00
Hao Li 87308167b1
KAFKA-15022: [8/N] more tests for HAAssignor (#14164)
Part of KIP-925.

- Add more tests for HighAvailabilityTaskAssignor
- Remove null and optional check for RackAwareTaskAssignor
- Pass rack aware assignor configs to getMainConsumerConfigs so that they can be picked up in rebalance protocol
- Change STATELESS_NON_OVERLAP_COST to 0. It was a mistake to be 1. Stateless tasks should be moved without this cost.
- Update of existing tests

Reviewers: Matthias J. Sax <matthias@confluent.io>
2023-08-09 16:42:53 -07:00
José Armando García Sancio dafe51b658
KAFKA-15100; KRaft data race with the expiration service (#14141)
The KRaft client uses an expiration service to complete FETCH requests that have timed out. This expiration service uses a different thread from the KRaft polling thread. This means that it is unsafe for the expiration service thread to call tryCompleteFetchRequest. tryCompleteFetchRequest reads and updates a lot of states that is assumed to be only be read and updated from the polling thread.

The KRaft client now does not call tryCompleteFetchRequest when the FETCH request has expired. It instead will send the FETCH response that was computed when the FETCH request was first handled.

This change also fixes a bug where the KRaft client was not sending the FETCH response immediately, if the response contained a diverging epoch or snapshot id.

Reviewers: Jason Gustafson <jason@confluent.io>
2023-08-09 07:12:08 -07:00
Yash Mayya f23394336a
MINOR: Use Mockito's strict stubs functionality for Connect tests and cleanup unused stubs (#14166)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2023-08-09 11:13:28 +02:00
Nikolay ddeb89f4a9
KAFKA-14595: Move AdminUtils to server-common (#14096)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2023-08-09 10:32:45 +02:00
Colin Patrick McCabe 9bc4a2d4d1
KAFKA-15271: Historicalterator can exposes elements that are too new (#14125)
A HistoricalIterator at epoch N is supposed to only reveal elements at epoch N or earlier. However,
due to a bug, we sometimes will reveal elements which are at a newer epoch than N. The bug does
not affect elements that are in the latest epoch (aka topTier). It only affects elements that are
newer than N, but which do not persist until the latest epoch.  This PR fixes the bug and adds a
unit test for this case.

Reviewers: David Arthur <mumrah@gmail.com>
2023-08-08 16:36:59 -07:00
José Armando García Sancio e0727063f7
KAFKA-15312; Force channel before atomic file move (#14162)
On ext4 file systems we have seen snapshots with zero-length files. This is possible if
the file is closed and moved before forcing the channel to write to disk.

Reviewers: Ron Dagostino <rndgstn@gmail.com>, Alok Thatikunta <athatikunta@confluent.io>
2023-08-08 14:31:42 -07:00
Lucia Cerchie a1cb4b4025
add changes made before merge (#14137)
Change in response to KIP-941.

New PR due to merge issue.

Changes line 57 in the RangeQuery class file from:

public static <K, V> RangeQuery<K, V> withRange(final K lower, final K upper) {
    return new RangeQuery<>(Optional.of(lower), Optional.of(upper));
}
to

public static <K, V> RangeQuery<K, V> withRange(final K lower, final K upper) {
     return new RangeQuery<>(Optional.ofNullable(lower), Optional.ofNullable(upper));
 }
Testing strategy:

Since null values can now be entered in RangeQuerys in order to receive full scans, I changed the logic defining query starting at line 1085 in IQv2StoreIntegrationTest.java from:

        final RangeQuery<Integer, V> query;
        if (lower.isPresent() && upper.isPresent()) {
            query = RangeQuery.withRange(lower.get(), upper.get());
        } else if (lower.isPresent()) {
            query = RangeQuery.withLowerBound(lower.get());
        } else if (upper.isPresent()) {
            query = RangeQuery.withUpperBound(upper.get());
        } else {
            query = RangeQuery.withNoBounds();
        }
to

query = RangeQuery.withRange(lower.orElse(null), upper.orElse(null));
because different combinations of isPresent() in the bounds is no longer necessary.

Reviewers: John Roesler <vvcephei@apache.org>, Bill Bejeck <bbejeck@apache.org>
2023-08-08 15:03:42 -04:00
Greg Harris ff4fed5cbe
KAFKA-15031: Add plugin.discovery to Connect worker configuration (KIP-898) (#14055)
Reviewers: Chris Egerton <chrise@aiven.io>
2023-08-08 10:06:35 -07:00