Commit Graph

3289 Commits

Author SHA1 Message Date
Colin Patrick McCabe 772f2cfc82
MINOR: Replace BrokerStates.scala with BrokerState.java (#10028)
Replace BrokerStates.scala with BrokerState.java, to make it easier to use from Java code if needed.  This also makes it easier to go from a numeric type to an enum.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-02-03 13:41:38 -08:00
Jason Gustafson 3acc193853
MINOR: Add mock implementation of `BrokerToControllerChannelManager` (#10026)
Tests involving `BrokerToControllerChannelManager` are simplified by being able to leverage `MockClient`. This patch introduces a `MockBrokerToControllerChannelManager` implementation which makes that possible.

The patch updates `ForwardingManagerTest` to use `MockBrokerToControllerChannelManager`. We also add a couple additional timeout cases, which exposed a minor bug. Previously we were using the wrong `TimeoutException`, which meant that expected timeout errors were in fact translated to `UNKNOWN_SERVER_ERROR`.

Reviewers: David Arthur <david.arthur@confluent.io>
2021-02-03 10:30:20 -08:00
Ron Dagostino 49f9229ea6
MINOR: Introduce ProducerIdGenerator trait (#10009)
`ProducerIdManager` is an existing class that talks to ZooKeeper directly.  We won't have ZooKeeper
when using a Raft-based metadata quorum, so we need an abstraction for the functionality of
generating producer IDs.  This PR introduces `ProducerIdGenerator` for this purpose, and we pass
an implementation when instantiating `TransactionCoordinator` rather than letting
`TransactionCoordinator.apply()` itself always create a ZooKeeper-based instance.

Reviewers: David Arthur <mumrah@gmail.com>, Ismael Juma <ismael@juma.me.uk>
2021-02-03 08:11:22 -08:00
Alok Nikhil 3f36f9a7ca
KAFKA-12249: Add client-side Decommission Broker RPC (KIP-500) (#9996)
Reviewers: Jason Gustafson <jason@confluent.io>
2021-02-03 05:46:46 -08:00
Ron Dagostino e31d3d4642
MINOR: Add HostedPartition.Deferred state in ReplicaManager (#10003)
Brokers receive metadata from the Raft metadata quorum very differently than they do from
ZooKeeper today, and this has implications for ReplicaManager.  In particular, when a broker
reads the metadata log it may not arrive at the ultimate state for a partition until it reads multiple
messages.  In normal operation the multiple messages associated with a state change will all
appear in a single batch, so they can and will be coalesced and applied together.  There are
circumstances where messages associated with partition state changes will appear across
multiple batches and we will be forced to coalesce these multiple batches together.  The
circumstances when this occurs are as follows:

- When the broker restarts it must "catch up" on the metadata log, and it is likely that the
broker will see multiple partition state changes for a single partition across different
batches while it is catching up.  For example, it will see the `TopicRecord` and the
`PartitionRecords` for the topic creation, and then it will see any `IsrChangeRecords`
that may have been recorded since the creation.  The broker does not know the state of
the topic partitions until it reads and coalesces all the messages.
- The broker will have to "catch up" on the metadata log if it becomes fenced and then
regains its lease and resumes communication with the metadata quorum.
- A fenced broker may ultimately have to perform a "soft restart" if it was fenced for so
long that the point at which it needs to resume fetching the metadata log has been
subsumed into a metadata snapshot and is no longer independently fetchable.  A soft
restart will entail some kind of metadata reset based on the latest available snapshot
plus a catchup phase to fetch after the snapshot end point.

The first case -- during startup -- occurs before clients are able to connect to the broker.
Clients are able to connect to the broker in the second case.  It is unclear if clients will be
able to to connect to the broker during a soft restart (the third case).

We need a way to defer the application of topic partition metadata in all of the above cases,
and while we are deferring the application of the metadata the broker will not service clients
for the affected partitions.

As a side note, it is arguable if the broker should be able to service clients while catching up
or not.  The decision to not service clients has no impact in the startup case -- clients can't
connect yet at that point anyway.  In the third case it is not yet clear what we are going to do,
but being unable to service clients while performing a soft reset seems reasonable.  In the
second case it is most likely true that we will catch up quickly; it would be unusual to
reestablish communication with the metadata quorum such that we gain a new lease and
begin to catch up only to lose our lease again.

So we need a way to defer the application of partition metadata and make those partitions
unavailable while deferring state changes.  This PR adds a new internal partition state to
ReplicaManager to accomplish this.  Currently the available partition states are simple
`Online`, `Offline` (meaning a log dir failure) and `None` (meaning we don't know about it). 
We add a new `Deferred` state.  We also rename a couple of methods that refer to
"nonOffline" partitions to instead refer to "online" partitions.

**The new `Deferred` state never happens when using ZooKeeper for metadata storage.**
Partitions can only enter the `Deferred` state when using a KIP-500 Raft metadata quorum
and one of the above 3 cases occurs.  The testing strategy is therefore to leverage existing
tests to confirm that there is no functionality change in the ZooKeeper case.  We will add
the logic for deferring/applying/reacting to deferred partition state in separate PRs since
that code will never be invoked in the ZooKeeper world.

Reviewers: Jason Gustafson <jason@confluent.io>, Ismael Juma <ismael@juma.me.uk>
2021-02-03 01:19:36 -08:00
Colin P. Mccabe 2ab5301085 MINOR: Upstream QuotaConfigs
This PR moves static property definitions for user client quotas into a
new class called QuotaConfigs in the clients module under the
o.a.k.common.config.internals package. This is needed to support the
client quotas work in the quorum based controller.

Reviewers: Colin McCabe <cmccabe@apache.org>
2021-02-02 21:29:51 -08:00
dengziming 1390d02ce4
MINOR: remove useless repeated method call in KafkaApiTest (#9988)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2021-02-03 12:12:11 +08:00
Rajini Sivaram 5c562efb2d
KAFKA-10700 - Support mutual TLS authentication for SASL_SSL listeners (KIP-684) (#10007)
mTLS is enabled if listener-prefixed ssl.client.auth is configured for SASL_SSL listeners. Broker-wide ssl.client.auth is not applied to SASL_SSL listeners as before, but we now print a warning.

Reviewers: David Jacot <djacot@confluent.io>
2021-02-02 14:56:23 +00:00
Alok Nikhil a022072df3
KAFKA-12248; Add BrokerHeartbeat/BrokerRegistration RPCs for KIP-500 (#9994)
This patch adds the schemas and request/response objects for the `BrokerHeartbeat` and `BrokerRegistration` APIs that were added as part of KIP-631. These APIs are only exposed by the KIP-500 controller and not advertised by the broker.

Reviewers: Jason Gustafson <jason@confluent.io>
2021-02-01 21:59:30 -08:00
Jason Gustafson 62218a05d3
MINOR: Factor out controller node provider `BrokerToControllerChannelManager` (#10015)
This patch factors out a trait to allow for other ways to provide the controller `Node` object to `BrokerToControllerChannelManager`. In KIP-500, the controller will be provided from the Raft client and not the metadata cache.

Reviewers: David Arthur <david.arthur@confluent.io>
2021-02-01 14:30:53 -08:00
Luke Chen 7feb55731e
KAFKA-7940: Fix flaky test case in `CustomQuotaCallbackTest` (#9777)
This patch attempts to fix `CustomQuotaCallbackTest#testCustomQuotaCallback`. The test creates 99 partitions in a topic, and expects that we can get the partition info for all of them after 15 seconds. If we cannot, then we'll get the error:
```
org.scalatest.exceptions.TestFailedException: Partition [group1_largeTopic,69] metadata not propagated after 15000 ms
```
15 secs is not enough to complete the 99 partitions creation on a slow system. So, we fix it by explicitly wait until we've got the expected partition size before retrieving each partition info and we increase the wait time to 60s for all partition metadata to be propagated.

Reviewers: Jason Gustafson <jason@confluent.io>
2021-02-01 10:16:28 -08:00
feyman2016 db73d86ea6
KAFKA-10636; Bypass log validation and offset assignment for writes from the raft leader (#9739)
Since the Raft leader is already doing the work of assigning offsets and the leader epoch, we can skip the same logic in `Log.appendAsLeader`. This lets us avoid an unnecessary round of decompression.

Reviewers: dengziming <dengziming1993@gmail.com>, Jason Gustafson <jason@confluent.io>
2021-02-01 10:05:47 -08:00
Jason Gustafson 7205cd36e4
KAFKA-12236; New meta.properties logic for KIP-500 (#9967)
This patch contains the new handling of `meta.properties` required by the KIP-500 server as specified in KIP-631. When using the self-managed quorum, the `meta.properties` file is required in each log directory with the new `version` property set to 1. It must include the `cluster.id` property and it must have a `node.id` matching that in the configuration.

The behavior of `meta.properties` for the Zookeeper-based `KafkaServer` does not change. We treat `meta.properties` as optional and as if it were `version=0`. We continue to generate the clusterId and/or the brokerId through Zookeeper as needed.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2021-01-30 17:05:31 -08:00
Jason Gustafson e9edf10486
KAFKA-12238; Implement `DescribeProducers` API from KIP-664 (#9979)
Implements the `DescribeProducers` API specified by KIP-664: https://cwiki.apache.org/confluence/display/KAFKA/KIP-664%3A+Provide+tooling+to+detect+and+abort+hanging+transactions.

Reviewers: David Jacot <djacot@confluent.io>
2021-01-29 17:00:14 -08:00
José Armando García Sancio 5b3351e10b
KAFKA-10761; Kafka Raft update log start offset (#9816)
Adds support for nonzero log start offsets.

Changes to `Log`:
1. Add a new "reason" for increasing the log start offset. This is used by `KafkaMetadataLog` when a snapshot is generated.
2. `LogAppendInfo` should return if it was rolled because of an records append. A log is rolled when a new segment is created. This is used by `KafkaMetadataLog` to in some cases delete the created segment based on the log start offset.

Changes to `KafkaMetadataLog`:
1. Update both append functions to delete old segments based on the log start offset whenever the log is rolled.
2. Update `lastFetchedEpoch` to return the epoch of the latest snapshot whenever the log is empty.
3. Add a function that empties the log whenever the latest snapshot is greater than the replicated log. This is used when first loading the `KafkaMetadataLog` and whenever the `KafkaRaftClient` downloads a snapshot from the leader.

Changes to `KafkaRaftClient`:
1. Improve `validateFetchOffsetAndEpoch` so that it can handle fetch offset and last fetched epoch that are smaller than the log start offset. This is in addition to the existing code that check for a diverging log. This is used by the raft client to determine if the Fetch response should include a diverging epoch or a snapshot id. 
2. When a follower finishes fetching a snapshot from the leader fully truncate the local log.
3. When polling the current state the raft client should check if the state machine has generated a new snapshot and update the log start offset accordingly.

Reviewers: Jason Gustafson <jason@confluent.io>
2021-01-29 14:06:01 -08:00
Justine Olshan 4f588f7ca2
KAFKA-10764: Add support for returning topic IDs on create, supplying topic IDs for delete (#9684)
Updated CreateTopicResponse, DeleteTopicsRequest/Response and added some new AdminClient methods and classes. Now the newly created topic ID will be returned in CreateTopicsResult and found in TopicAndMetadataConfig, and topics can be deleted by supplying topic IDs through deleteTopicsWithIds which will return DeleteTopicsWithIdsResult.

Reviewers: dengziming <dengziming1993@gmail.com>, Rajini Sivaram <rajinisivaram@googlemail.com>
2021-01-29 19:40:16 +00:00
Jason Gustafson d87fc21763
MINOR: Ensure `InterBrokerSendThread` closes `NetworkClient` (#9999)
We should ensure `NetworkClient` is closed properly when `InterBrokerSendThread` is shutdown. Also use `initiateShutdown` instead of `wakeup()` to alert polling thread.

Reviewers: David Jacot <djacot@confluent.io>
2021-01-29 11:37:43 -08:00
Lee Dongjin e3ff4b0870
KAFKA-10604: Fix Streams default state.dir (#9420)
Make the default state store directory location to follow
OS-specific temporary directory settings or java.io.tmpdir
JVM parameter, with Utils#getTempDir.

Reviewers: Matthias J. Sax <mjsax@apache.org>, John Roesler <vvcephei@apache.org>
2021-01-29 09:45:13 -06:00
Alok Nikhil 27a998e8a0
KAFKA-12237; Support lazy initialization of quorum voter addresses (#9985)
With KIP-595, we previously expect `RaftConfig` to specify the quorum voter endpoints upfront on startup. In the general case, this works fine. However, for testing where the bound port is not known ahead of time, we need a lazier approach that discovers the other voters in the quorum after startup. 

In this patch, we take the voter endpoint initialization out of `KafkaRaftClient.initialize` and move it to `RaftManager`. We use a special address to indicate that the voter addresses will be provided later This approach also lends itself well to future use cases where we might discover voter addresses through an external service (for example).

Reviewers: Jason Gustafson <jason@confluent.io>
2021-01-28 17:14:56 -08:00
John Roesler fdcf8fbf72
KAFKA-10866: Add metadata to ConsumerRecords (#9836)
Expose fetched metadata via the ConsumerRecords
object as described in KIP-695.

Reviewers: Guozhang Wang <guozhang@apache.org>
2021-01-27 18:18:38 -06:00
Kowshik Prakasam 4075a5c8e8
MINOR: Call logSegments.toBuffer only when required (#9971)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Satish Duggana <satishd@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2021-01-27 12:43:10 +08:00
Kowshik Prakasam 7230d148f4
MINOR: Fix visibility of Log.{unflushedMessages, addSegment} methods (#9966)
Reviewers: Jun Rao <junrao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2021-01-26 13:59:33 +08:00
dengziming f4c2030b20
MINOR: Optimize assertions in unit tests (#9955)
Reviewers: David Jacot <djacot@confluent.io>
2021-01-24 08:47:37 +01:00
Jason Gustafson 6d411620dd
MINOR: A few small group coordinator cleanups (#9952)
A few small cleanups in `GroupCoordinator` and related classes:

- Remove redundant `groupId` field from `MemberMetadata`
- Remove redundant `isStaticMember` field from `MemberMetadata`
- Fix broken log message in `GroupMetadata.loadGroup` and apply it to all loaded members
- Remove ancient TODOs and no-op methods from `GroupCoordinator`
- Move removal of static members into `GroupMetadata.remove`

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Jacot <djacot@confluent.io>
2021-01-23 13:07:31 -08:00
David Jacot 7a1d1d9a69
KAFKA-12212; Bump Metadata API version to remove `ClusterAuthorizedOperations` fields (KIP-700) (#9945)
This patch bumps the version of the Metadata API and removes the `IncludeClusterAuthorizedOperations` and the `IncludeClusterAuthorizedOperations` fields from version 11 and onward.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Rajini Sivaram <rajinisivaram@googlemail.com>
2021-01-22 09:06:37 +01:00
Jason Gustafson 9689a313f5
MINOR: Drop enable.metadata.quorum config (#9934)
The primary purpose of this patch is to remove the internal `enable.metadata.quorum` configuration. Instead, we rely on `process.roles` to determine if the self-managed quorum has been enabled. As a part of this, I've done the following:

1. Replace the notion of "disabled" APIs with "controller-only" APIs. We previously marked some APIs which were intended only for the KIP-500 as "disabled" so that they would not be unintentionally exposed. For example, the Raft quorum APIs were disabled. Marking them as "controller-only" carries the same effect, but makes the intent that they should be only exposed by the KIP-500 controller clearer.
2. Make `ForwardingManager` optional in `KafkaServer` and `KafkaApis`. Previously we used `null` if forwarding was enabled and relied on the metadata quorum check.
3. Make `zookeeper.connect` an optional configuration if `process.roles` is defined.
4. Update raft README to remove reference to `zookeeper.conntect`

Reviewers: Colin Patrick McCabe <cmccabe@confluent.io>, Boyang Chen <boyang@confluent.io>
2021-01-21 15:16:15 -08:00
Alok Nikhil fea2f65929
MINOR: Import RaftConfig config definitions into KafkaConfig (#9916)
This patch moves Raft config definitions from `RaftConfig` to `KafkaConfig`, where they are re-defined as internal configs until we are ready to expose them. It also adds the missing "controller" prefix that was added by KIP-631.

Reviewers: Jason Gustafson <jason@confluent.io>
2021-01-21 10:26:23 -08:00
David Jacot 24e7e81524
MINOR: Refactor DescribeAuthorizedOperationsTest (#9938)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-01-21 17:34:08 +01:00
17hao 62860fa0a1
MINOR: Remind user index file is empty when dumping LogSegment index file (#9891)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-01-21 12:06:35 +08:00
Justine Olshan 86b9fdef2b
KAFKA-10869: Gate topic IDs behind IBP 2.8 (KIP-516) (#9814)
Topics processed by the controller and topics newly created will only be given topic IDs if the inter-broker protocol version on the controller is greater than 2.8. This PR also adds a kafka config to specify whether the IBP is greater or equal to 2.8. System tests have been modified to include topic ID checks for upgrade/downgrade tests. This PR also adds a new integration test file for requests/responses that are not gated by IBP (ex: metadata) 

Reviewers: dengziming <dengziming1993@gmail.com>, Lucas Bradstreet <lucas@confluent.io>, Rajini Sivaram <rajinisivaram@googlemail.com>
2021-01-20 22:32:06 +00:00
Luke Chen 918c332cbf
KAFKA-8460: produce records with current timestamp (#9877)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2021-01-20 15:48:44 +08:00
David Jacot 302eee63c4
KAFKA-12204; Implement DescribeCluster API in the broker (KIP-700) (#9903)
This PR implements the DescribeCluster API in the broker.

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Ismael Juma <ismael@juma.me.uk>
2021-01-19 18:43:36 +01:00
Chia-Ping Tsai f7c0b0d172
MINOR: Replace ApiVersion by auto-generated protocol (#9746)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-01-20 00:37:45 +08:00
Geordie efff9db827
KAFKA-10841: Extract conversion from LogReadResult to FetchPartitionData (#9743)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Ismael Juma <ismael@juma.me.uk>
2021-01-18 16:55:21 -08:00
Chia-Ping Tsai 5a4bbb9f91
KAFKA-7341 Migrate core module to JUnit 5 (#9855)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-01-19 00:00:32 +08:00
Ismael Juma 6f9e73cfd8
MINOR: Move a few more methods to AuthHelper (#9913)
And move some tests to `AuthHelperTest`.

Reviewers: David Arthur <mumrah@gmail.com>
2021-01-16 06:44:02 -08:00
Boyang Chen bfc96efa3a
KAFKA-10674: Controller API version bond with forwardable APIs (#9600)
Get controller api version intersection setup for client queries. When the unsupported exception was hit in the EnvelopeResponse, close the client connection to let it rediscover the api version.

Reviewers: Jason Gustafson <jason@confluent.io>
2021-01-15 20:36:25 -08:00
Jason Gustafson 8f063c15da
MINOR: Generalize server startup to make way for KIP-500 (#9883)
This patch attempts to generalize server initialization for KIP-500. It adds a `Server` trait which `KafkaServer` extends for the legacy Zookeeper server, and a new `KafkaRaftServer` for the new server. I have also added stubs for `KafkaRaftBroker` and `KafkaRaftController` to give a clearer idea how this will be used.

Note that this patch removes `KafkaServerStartable`, which was intended to enable custom startup logic, but was not codified into an official API and is not planned to be supported after KIP-500. 

Reviewers: Ismael Juma <ismael@juma.me.uk>, Colin P. McCabe <cmccabe@apache.org>
2021-01-15 17:30:29 -08:00
Jason Gustafson 7ac06065f1
KAFKA-12161; Support raft observers with optional id (#9871)
We would like to be able to use `KafkaRaftClient` for tooling/debugging use cases. For this, we need the localId to be optional so that the client can be used more like a consumer. This is already supported in the `Fetch` protocol by setting `replicaId=-1`, which the Raft implementation checks for. We just need to alter `QuorumState` so that the `localId` is optional. The main benefit of doing this is that it saves tools the need to generate an arbitrary id (which might cause conflicts given limited Int32 space) and it lets the leader avoid any local state for these observers (such as `ReplicaState` inside `LeaderState`).

Reviewers: Ismael Juma <ismael@juma.me.uk>, Boyang Chen <boyang@confluent.io>
2021-01-15 14:10:17 -08:00
Colin Patrick McCabe b5c107363f
KAFKA-12208: Rename AdminManager to ZkAdminManager (#9900)
Rename AdminManager to ZkAdminManager to emphasize the fact that it is not used by the KIP-500 code paths.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Boyang Chen <boyang@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2021-01-15 12:56:09 -08:00
David Arthur ba1e16f0c0
MINOR: Upstream ApisUtils from kip-500 (#9715)
In the [KIP-500 development branch](https://github.com/confluentinc/kafka/tree/kip-500),
we have a separate ControllerApis that shares a lot of functionality with KafkaApis. We
introduced a utility class ApisUtils to pull out the common code. Some things were moved
to RequestChannel as well.

We'd like to upstream this work now so we don't continue to diverge (since KafkaApis is
a frequently modified class). There should be no logical changes in this PR, only shuffling
code around.

Reviewers: Jason Gustafson <jason@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>, Jose Sancio <jsancio@users.noreply.github.com>, Ismael Juma <ismael@juma.me.uk>
2021-01-15 12:28:43 -08:00
Chia-Ping Tsai 9361a43cfa
MINOR: remove unused flag 'hasIdempotentRecords' (#9884)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-01-16 00:53:14 +08:00
Alok Nikhil c49f660c62
MINOR: Initialize QuorumState lazily in RaftClient.initialize() (#9881)
It is helpful to delay initialization of the `RaftClient` configuration including the voter string until after construction. This helps in integration test cases where the voter ports may not be known until sockets are bound.

Reviewers: José Armando García Sancio <jsancio@users.noreply.github.com>, Jason Gustafson <jason@confluent.io>
2021-01-14 17:31:54 -08:00
wenbingshen 4a985b594f
MINOR: fix typo in TimeIndex (#9834)
fix typos in TimeIndex

Co-authored-by: wenbingshen <oliver.shen999@gmail.com>
Reviewers: Boyang Chen <boyang@confluent.io>
2021-01-14 13:25:48 -08:00
Luke Chen 2746af4535
MINOR: replace NotLeaderForPartitionException with NotLeaderOrFollowerException (#9885)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Ismael Juma <ismael@juma.me.uk>
2021-01-14 12:16:16 +00:00
David Arthur ee08b0b32a
Only schedule AlterIsr thread when we have an ISR change (#9749)
This patch removes the periodic scheduling of a thread to send AlterISR requests and instead sends a request as soon as an ISR update is ready to send. When a response is received, the callback checks for any unsent items and will schedule another request if necessary.
2021-01-13 13:52:38 -05:00
Jason Gustafson 474ad1eebd
KAFKA-12168; Move envelope request parsing out of SocketServer (#9850)
Prior to this patch, envelope handling was a shared responsibility between `SocketServer` and `KafkaApis`.  The former was responsible for parsing and validation, while the latter was responsible for authorization. This patch consolidates logic in `KafkaApis` so that envelope requests follow the normal request flow.

Reviewers: David Jacot <djacot@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2021-01-12 13:32:43 -08:00
Jason Gustafson f62c2b26cc
MINOR: Factor `RaftManager` out of `TestRaftServer` (#9839)
This patch factors out a `RaftManager` class from `TestRaftServer` which will be needed when we integrate this layer into the server. This class encapsulates the logic to build `KafkaRaftClient` as well as its IO thread. 

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-01-11 09:28:12 -08:00
dengziming 119a2d9127
MINOR: Substitute assertEquals(null) with assertNull (#9852)
Reviewers: David Jacot <djacot@confluent.io>
2021-01-10 20:06:37 +01:00
Chia-Ping Tsai 913a019d6c
MINOR: replace test "expected" parameter by assertThrows (#9520)
This PR includes following changes.

1. @Test(expected = Exception.class) is replaced by assertThrows
2. remove reference to org.scalatest.Assertions
3. change the magic code from 1 to 2 for testAppendAtInvalidOffset to test ZSTD
4. rename testMaybeAddPartitionToTransactionXXXX to testNotReadyForSendXXX
5. increase maxBlockMs from 1s to 3s to avoid unexpected timeout from TransactionsTest#testTimeout

Reviewers: Ismael Juma <ismael@confluent.io>
2021-01-10 20:20:13 +08:00