Commit Graph

9196 Commits

Author SHA1 Message Date
David Arthur 284ec262c6 KAFKA-12155: Metadata log and snapshot cleaning #10864
This PR includes changes to KafkaRaftClient and KafkaMetadataLog to support periodic
cleaning of old log segments and snapshots.

Four new public config keys are introduced: metadata.log.segment.bytes,
metadata.log.segment.ms, metadata.max.retention.bytes, and
metadata.max.retention.ms.

These are used to configure the log layer as well as the snapshot cleaning logic. Snapshot
and log cleaning is performed based on two criteria: total metadata log + snapshot size
(metadata.max.retention.bytes), and max age of a snapshot (metadata.max.retention.ms).
Since we have a requirement that the log start offset must always align with a snapshot,
we perform the cleaning on snapshots first and then clean what logs we can.

The cleaning algorithm follows:
1. Delete the oldest snapshot.
2. Advance the log start offset to the new oldest snapshot.
3. Request that the log layer clean any segments prior to the new log start offset
4. Repeat this until the retention size or time is no longer violated, or only a single
snapshot remains.

The cleaning process is triggered every 60 seconds from the KafkaRaftClient polling
thread.

Reviewers: José Armando García Sancio <jsancio@gmail.com>, dengziming <dengziming1993@gmail.com>, Colin P. McCabe <cmccabe@apache.org>
2021-07-06 14:19:44 -07:00
kpatelatwork 2e89f40575
KAFKA-13035 updated documentation for connector restart REST API to … (#10975)
Updated documentation for connector restart REST API to include the tasks restart behavior, including calling out that by default the same behavior of previous versions is preserved.

Author: Kalpesh Patel <kpatel@confluent.io>
Reviewer: Randall Hauch <rhauch@gmail.com>
2021-07-06 13:31:40 -05:00
Jason Gustafson f29c43bdbb
KAFKA-12979; Implement command to find hanging transactions (#10974)
This patch implements the `find-hanging` command described in KIP-664: https://cwiki.apache.org/confluence/display/KAFKA/KIP-664%3A+Provide+tooling+to+detect+and+abort+hanging+transactions#KIP664:Providetoolingtodetectandaborthangingtransactions-FindingHangingTransactions.

Reviewers: Luke Chen <showuon@gmail.com>, David Jacot <djacot@confluent.io>
2021-07-06 10:39:59 -07:00
thomaskwscott fb6425188c
KAFKA-12981; Ensure LogSegment.maxTimestampSoFar and LogSegment.offsetOfMaxTimestampSoFar are read/updated in sync (#10960)
This patch ensures that `maxTimestampSoFar` and `offsetOfMaxTimestampSoFar` are consistent with each others. It does so by storing them together. It relates to KIP-734 which exposes them via the admin client.

Reviewers: Ismael Juma <ismael@juma.me.uk>, David Jacot <djacot@confluent.io>
2021-07-06 19:28:09 +02:00
zhaohaidao 943967773d
KAFKA-12992; Make kraft configuration properties public (#10971)
This patch makes the following KRaft configurations public:

- `process.roles`
- `node.id`
- `initial.broker.registration.timeout.ms`
- `broker.heartbeat.interval.ms`
- `broker.session.timeout.ms`
- `metadata.log.dir`
- `controller.listener.names`
- `sasl.mechanism.controller.protocol`

Reviewers: Luke Chen <showuon@gmail.com>, Jason Gustafson <jason@confluent.io>
2021-07-05 17:21:40 -07:00
Tom Bentley 19e8fd513a
KAFKA-9687: KIP-707: Add KafkaFuture.toCompletionStage() (#9878)
* Improve the test prior to reimplementing KafkaFutureImpl using CompletableFuture.
* KAFKA-9687: Reimplement KafkaFutureImpl using a CompleteableFuture
* KIP-707: Add KafkaFuture.toCompletionStage

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Jacot <djacot@confluent.io>, Konstantine Karantasis <k.karantasis@gmail.com>
2021-07-05 17:33:33 +01:00
Rajini Sivaram 2b6365c78b
KAFKA-13029; Set appropriate fields for FindCoordinatorRequest based on version (#10965)
KIP-699 added support for batching in FindCoordinatorRequest using a new protocol that changes the wire format for both batched and unbatched requests. Clients were updated to try the new format first and switch irreversibly to the old format if the new format is not supported on one broker. During rolling upgrade (or a downgrade), it is possible that a broker doesn't support new format at some point while other brokers do at a later point. Clients end up in a bad state until restarted since they use new version with old format. This PR changes FindCoordinatorRequest to set data based on actual version when a single group is used. This is always the case for consumer coordinator and transaction manager. For admin API, we still switch to unbatched mode on failure, but the data is set based on actual version, so we never fail even if brokers are upgraded/downgraded.

Reviewers: Luke Chen <showuon@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>, David Jacot <djacot@confluent.io>
2021-07-05 14:26:03 +01:00
dengziming 16d224d35b
MINOR: Delete unused DeleteTopicsWithIdsResult (#10957)
Reviewers: Justine Olshan <jolshan@confluent.io>, David Jacot <djacot@confluent.io>
2021-07-05 09:26:59 +02:00
Justine Olshan c85d67796f
MINOR: fix comments on deleteTopics method (#10966)
Reviewers: Luke Chen <showuon@gmail.com>, David Jacot <djacot@confluent.io>
2021-07-05 09:25:17 +02:00
Ismael Juma 855011f92a
MINOR: Upgrade Gradle to 7.1.1 and remove JDK 15 build (#10968)
Gradle 7.1 improves Java incremental compilation:
https://docs.gradle.org/7.1.1/release-notes.html

We previously kept the JDK 15 build because some
tests didn't work with JDK 16. Since then, a number
of PRs were submitted to fix this so it's best
to remove the JDK 15 build before we create the
3.0 release branch.

Finally bump `test-retry` gradle plugin version too.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Luke Chen <showuon@gmail.com>
2021-07-04 10:55:16 -07:00
zhaohaidao 10b1f73cd4
KAFKA-12958: add an invariant that notified leaders are never asked to load snapshot (#10932)
Track handleSnapshot calls and make sure it is never triggered on the leader node.

Reviewers: Luke Chen <showuon@gmail.com>, José Armando García Sancio <jsancio@users.noreply.github.com>, Boyang Chen <bchen11@outlook.com>
2021-07-04 08:32:12 -07:00
Lee Dongjin fa685fa152
KAFKA-12985: Upgrade jetty to 9.4.42 (#10919)
* 9.4.41 announcement: https://www.eclipse.org/lists/jetty-announce/msg00156.html
* 9.4.42 announcement: https://www.eclipse.org/lists/jetty-announce/msg00158.html

Reviewers: Luke Chen <showuon@gmail.com>, Ismael Juma <ismael@juma.me.uk>
2021-07-04 07:48:25 -07:00
Ryanne Dolan 6d2f563865
KAFKA-12436: Deprecate MirrorMaker v1 (KIP-720) (#10805)
Reviewers: Luke Chen <showuon@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Mickael Maison <mickael.maison@gmail.com>
2021-07-04 15:17:31 +01:00
dengziming 08757d0d19
MINOR: Add default serde in stream test to fix QA ERROR (#10958)
We changed the default serde in Streams to be null in #10813, but forgot to add some in tests, for example TestTopicsTest and TopologyTestDriverTest.

Reviewers: David Jacot <djacot@confluent.io>, Bruno Cadonna <cadonna@apache.org>
2021-07-02 20:02:20 +02:00
Chris Egerton cad2f5e120
KAFKA-12717: Remove internal Connect converter properties (KIP-738) (#10854)
Removed Connect Distributed worker's internal converter properties.

Author: Chris Egerton <chrise@confluent.io>
Reviewer: Randall Hauch <rhauch@gmail.com>
2021-07-01 21:02:24 -05:00
OmniaGM 51796bcdef KAFKA-10587; Rename kafka-mirror-maker CLI command line arguments for KIP-629
[KAFKA-10587](https://issues.apache.org/jira/browse/KAFKA-10587) Rename kafka-mirror-maker CLI command line arguments for KIP-629
Replace "whitelist" argument in kafka-mirror-maker cli command with "include"

Author: OmniaGM <o.g.h.ibrahim@gmail.com>

Reviewers: Luke Chen, Xavier Leaute, Gwen Shapira

Closes #10937 from OmniaGM/KAFKA-10587
2021-07-01 18:56:35 -07:00
José Armando García Sancio 9f01909dc3
KAFKA-12997: Expose the append time for batches from raft (#10946)
Add the record append time to Batch. Change SnapshotReader to set this time to the
time of the last log in the last batch. Fix the QuorumController to remember the last
committed batch append time and to store it in the generated snapshot.

Reviewers: David Arthur <mumrah@gmail.com>, Luke Chen <showuon@gmail.com>, Colin P. McCabe <cmccabe@apache.org>
2021-07-01 16:38:59 -07:00
Matthias J. Sax a095e1fd8c
KAFKA-10847: improve throughput of stream-stream join with spurious left/outer join fix (#10917)
The fix to avoid spurious left/outer stream-stream join results, showed
very low throughput for RocksDB, due to excessive creation of iterators.
Instead of trying to emit left/outer stream-stream join result for every
input record, this PR adds tracking of the lower timestamp bound of
left/outer join candidates, and only tries to emit them (and create an
iterator) if they are potentially old enough.

Reviewers: Luke Chen <showuon@gmail.com>, Guozhang Wang <guozhang@confluent.io>, Sergio Peña <sergio@confluent.io>
2021-07-01 15:46:22 -07:00
leah 4fd71a7ef1
KAFKA-9559: Change default serde to be `null` (#10813)
Implements KIP-741

Reviewers: Matthias J. Sax <matthias@confluent.io>
2021-07-01 14:58:29 -07:00
Gardner Vickers 789fc26042
KAFKA-12964: Collect and rename snapshot files prior to async deletion. (#10896)
Segment and index files are currently renamed with a .deleted
suffix prior to async deletion. This serves two purposes, to
resume deletion on broker failure and also protect against
deletion of new segments during truncation (due to deletion
being async).

We should do the same for snapshot files. While they are not subject
to issues around resuming deletion due to the stray snapshot
scanning which is performed on log initialization, we can end up
with situations where truncation queues snapshots for deletion, but
prior to deletion new segments with the same snapshot file name are
created. Async deletion can then delete these new snapshots.

This patch offers a two-stage snapshot deletion which first renames
and removes the segments in question from the ProducerStateManager,
allowing the Log to asynchronously delete them.

Credit to Kowshik Prakasam <kowshik@gmail.com> for finding this issue
and creating the test demonstrating the failure.

Co-authored-by: Kowshik Prakasam <kowshik@gmail.com> Address PR feedback

Reviewers: Kowshik Prakasam <kprakasam@confluent.io>, Jun Rao <junrao@gmail.com>
2021-07-01 14:23:58 -07:00
Jeff Kim 8cd04cb1a0
KAFKA-13007; KafkaAdminClient getListOffsetsCalls reuse cluster snapshot (#10940)
In getListOffsetsCalls, we rebuild the cluster snapshot for every topic partition. instead, we should reuse a snapshot.

For manual testing (used AK 2.8), i've passed in a map of 6K topic partitions to listOffsets

Without snapshot reuse:
duration of building futures from metadata response: **15582** milliseconds
total duration of listOffsets: **15743** milliseconds

With reuse:
duration of building futures from metadata response: **24** milliseconds
total duration of listOffsets: **235** milliseconds

Reviewers: Luke Chen <showuon@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Jason Gustafson <jason@confluent.io>
2021-07-01 14:16:35 -07:00
Mickael Maison f5d5f654db
KAFKA-12663: Update FindCoordinator to support batch lookups (KIP-699) (#10743)
This implements KIP-699: https://cwiki.apache.org/confluence/display/KAFKA/KIP-699%3A+Update+FindCoordinator+to+resolve+multiple+Coordinators+at+a+time

It updates FindCoordinator request and response to support resolving multiple coordinators at a time. If a broker does not support the new FindCoordinator version, clients can revert to the previous behaviour and use a request for each coordinator.

Reviewers: David Jacot <djacot@confluent.io>, Tom Bentley <tbentley@redhat.com>, Sanjana Kaundinya <skaundinya@gmail.com>
2021-07-01 22:05:03 +01:00
Warren Zhu c92d013fd4
KAFKA-10619: Configure producer with idempotence and acks all by default (KIP-679) (#9497)
This PR relies on existing tests. A subsequent PR will make additional test adjustments
to ensure coverage of the non-default behavior is still good after this change.

Reviewers: Cheng Tan <31675100+d8tltanc@users.noreply.github.com>, Ismael Juma <ismael@juma.me.uk>
2021-07-01 07:06:27 -07:00
Ryanne Dolan 93f57370c6
KAFKA-9726: Add IdentityReplicationPolicy to MirrorMaker2 (#10652)
This new policy enables active/passive, one-way replication without renaming topics, similar to MM1. This implementation is described in KIP-382 (adopted), originally as "LegacyReplicationPolicy".

This enables operators to migrate from MM1 to MM2 without re-architecting their replication flows, and enables some additional use-cases for MM2. For example, operators may wish to "upgrade" their Kafka clusters by mirroring everything to a completely new cluster. Such a migration would have been difficult with either MM1 or MM2 previously.

When using IdentityReplicationPolicy, operators should be aware that MM2 will not be able to detect cycles among replicated topics. A misconfigured topology may result in replicating the same records back-and-forth or in an infinite loop. However, we don't prevent this behavior, as some use-cases involve filtering records (via SMTs) to prevent cycles.

Reviewers: Mickael Maison <mickael.maison@gmail.com>

Co-authored-by: Ryanne Dolan <rdolan@twitter.com>
Co-authored-by: Matthew de Detrich <mdedetrich@gmail.com>
Co-authored-by: Ivan Yurchenko <ivanyu@aiven.io>
2021-07-01 09:21:27 +01:00
Colin Patrick McCabe b4e45cd0d2
KAFKA-13019: Add MetadataImage and MetadataDelta classes for KRaft Snapshots (#10949)
Create the image/ module for storing, reading, and writing broker metadata images.
Metadata images are immutable. New images are produced from existing images
using delta classes. Delta classes are mutable, and represent changes to a base
image.

MetadataImage objects can be converted to lists of KRaft metadata records. This
is essentially writing a KRaft snapshot. The resulting snapshot can be read
back into a MetadataDelta object. In practice, we will typically read the
snapshot, and then read a few more records to get fully up to date. After that,
the MetadataDelta can be converted to a MetadataImage as usual.

Sometimes, we have to load a snapshot even though we already have an existing
non-empty MetadataImage. We would do this if the broker fell too far behind and
needed to receive a snapshot to catch up. This is handled just like the normal
snapshot loading process. Anything that is not in the snapshot will be marked
as deleted in the MetadataDelta once finishSnapshot() is called.

In addition to being used for reading and writing snapshots, MetadataImage also
serves as a cache for broker information in memory. A follow-up PR will replace
MetadataCache, CachedConfigRepository, and the client quotas cache with the
corresponding Image classes. TopicsDelta also replaces the "deferred
partition" state that the RaftReplicaManager currently implements. (That change
is also in a follow-up PR.)

Reviewers: Jason Gustafson <jason@confluent.io>, David Arthur <mumrah@gmail.com>
2021-07-01 00:08:25 -07:00
thomaskwscott 593b34a5be
KAFKA-13002: listOffsets must downgrade immediately for non MAX_TIMESTAMP specs (#10936)
This patch fixes a regression introduced https://github.com/apache/kafka/pull/10760. The downgrade logic was not downgrading the version when only non MAX_TIMESTAMP specs were used.

Reviewers: David Jacot <djacot@confluent.io>
2021-07-01 08:35:55 +02:00
Justine Olshan cee2e975d1
KAFKA-13011; Update deleteTopics Admin API (#10892)
This patch adds two new apis to support topic deletion using topic IDs or names. It uses a new class `TopicCollection` to keep a collection of topics defined either by names or IDs. Finally, it modifies `DeleteTopicsResult` to support both names and IDs and deprecates the old methods which have become ambiguous. Eventually we will want to deprecate the old `deleteTopics` apis as well, but this patch does not do so.

Reviewers: Jason Gustafson <jason@confluent.io>
2021-06-30 23:20:21 -07:00
kpatelatwork 527ba111c7
KAFKA-4793: Connect API to restart connector and tasks (KIP-745) (#10822)
Implements KIP-745 https://cwiki.apache.org/confluence/display/KAFKA/KIP-745%3A+Connect+API+to+restart+connector+and+tasks to change connector REST API to restart a connector and its tasks as a whole.

Testing strategy 
- [x]  Unit tests added for all possible combinations of onlyFailed and includeTasks
- [x]  Integration tests added for all possible combinations of onlyFailed and includeTasks
- [x]  System tests for happy path 

Reviewers: Randall Hauch <rhauch@gmail.com>, Diego Erdody <erdody@gmail.com>, Konstantine Karantasis <k.karantasis@gmail.com>
2021-06-30 21:13:07 -07:00
José Armando García Sancio 1b7ab8eb9f
KAFKA-12863: Configure controller snapshot generation (#10812)
Add the ability for KRaft controllers to generate snapshots based on the number of new record bytes that have 
been applied since the last snapshot. Add a new configuration key to control this parameter. For now, it
defaults to being off, although we will change that in a follow-on PR. Also, fix LocalLogManager so that
snapshot loading is only triggered when the listener is not the leader.

Reviewers: Colin P. McCabe <cmccabe@apache.org>
2021-06-30 18:13:53 -07:00
Israel Ekpo b3905d9f71
KAFKA-8613: New APIs for Controlling Grace Period for Windowed Operations (#10926)
Implements KIP-633.

Grace-period is an important parameter and its best to make it the user's responsibility to set it expliclity. Thus, we move off to provide a default and make it a mandatory parameter when creating a window.

Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Luke Chen <showuon@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2021-06-30 17:09:19 -07:00
Colin Patrick McCabe a10e4e8547
MINOR: Some broker code cleanups #10948
Fix the JavaDoc for the ClientQuotaManagerConfig#throttle function to
refer to the correct parameter name.

BrokerEndPointTest#testHashAndEquals should test the BrokerEndPoint
class, rather than the MetadataBroker class.

TopicConfigHandler: make the kafkaController argument optional, since we won't
have it when in KRaft mode.

Remove the unecessary ConfigRepository argument for the Partition class.

Remove the unused TestUtils#deleteBrokersInZk function.

Reviewers: Jason Gustafson <jason@confluent.io>
2021-06-30 14:58:01 -07:00
Ron Dagostino 4f5b4c868e
KAFKA-12756: Update ZooKeeper to v3.6.3 (#10918)
Update the ZooKeeper version to v3.6.3. This requires adding dropwizard
as a new dependency.

Also, add Kafka v2.8.0 to the ducktape system test image.

Reviewers: Luke Chen <showuon@gmail.com>, Colin P. McCabe <cmccabe@apache.org>, Ismael Juma <ismael@juma.me.uk>
2021-06-30 11:21:33 -07:00
dengziming b1562a90e0
MINOR: Replace easymock with mockito in log4j-appender (#10852)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-06-30 01:25:08 -07:00
Bruno Cadonna 19edbda164
Avoid increasing app ID when test is executed multiple times (#10939)
The integration test TaskMetadataIntegrationTest will increase
the length of the app ID when its test methods are called multiple
times in one execution. This is for example the case if you
repeatedly run the test until failure in IntelliJ IDEA. This might
also lead to exceptions because the state directory depends on the
app ID and directory names have a length limit.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2021-06-30 09:55:27 +02:00
Colin Patrick McCabe 9f71db96fd
MINOR: Move ZkMetadataCache into its own file. (#10942)
Reviewers: Jason Gustafson <jason@confluent.io>
2021-06-29 16:03:02 -07:00
Colin Patrick McCabe d9b898b678
MINOR: Refactor the MetadataCache interface (#10887)
Remove getNonExistingTopics, which was not necessary. MetadataCache
already lets callers check for the existence of topics by calling
MetadataCache#contains.

Add MetadataCache#getAliveBrokerNode and getAliveBrokerNodes. This
simplifies the calling code, which always wants a Node.

Fix a case where we were calling getAliveBrokers and filtering by id,
rather than simply calling getAliveBroker(id) and making use of the hash
map.

Reviewers: Jason Gustafson <jason@confluent.io>, Jose Sancio <jsancio@gmail.com>
2021-06-29 15:59:20 -07:00
Mickael Maison 3c4be0b57a
KAFKA-12379: Allow configuring the location of the offset-syncs topic with MirrorMaker2 (#10221)
This commit implements KIP-716. It introduces a new setting `offset-syncs.topic.location` that allows specifying where the offset-syncs topic is created.

Reviewers: Tom Bentley <tbentley@redhat.com>, Edoardo Comar <ecomar@uk.ibm.com>
2021-06-29 21:33:59 +01:00
Niket d3ec9f940c
KAFKA-12952 Add header and footer records for raft snapshots (#10899)
Add header and footer records for raft snapshots. This helps identify when the snapshot
starts and ends. The header also contains a time.  The time field is currently set to 0.
KAFKA-12997 will add in the necessary wiring to use the correct timestamp.

Reviewers: Jose Sancio <jsancio@gmail.com>, Colin P. McCabe <cmccabe@apache.org>
2021-06-29 09:37:20 -07:00
Cong Ding 0b6d6b1785
KAFKA-12520: Ensure log loading does not truncate producer state unless required (#10763)
When we find a .swap file on startup, we typically want to rename and replace it as .log, .index, .timeindex, etc. as a way to complete any ongoing replace operations. These swap files are usually known to have been flushed to disk before the replace operation begins.

One flaw in the current logic is that we recover these swap files on startup and as part of that, end up truncating the producer state and rebuild it from scratch. This is unneeded as the replace operation does not mutate the producer state by itself. It is only meant to replace the .log file along with corresponding indices. Because of this unneeded producer state rebuild operation, we have seen multi-hour startup times for clusters that have large compacted topics.

This patch fixes the issue. With ext4 ordered mode, the metadata are ordered and no matter it is a clean/unclean shutdown. As a result, we rework the recovery workflow as follows.

If there are any .cleaned files, we delete all .swap files with higher/equal offsets due to KAFKA-6264. We also delete the .cleaned files. If no .cleaned file, do nothing for this step.
If there are any .log.swap files left after step 1, they, together with their index files, must be renamed from .cleaned and are complete (renaming from .cleaned to .swap is in reverse offset order). We rename these .log.swap files and their corresponding index files to regular files, while deleting the original files from compaction or segment split if they haven't been deleted.
Do log splitting for legacy log segments with offset overflow (KAFKA-6264)
If there are any other index swap files left, they must come from partial renaming from .swap files to regular files. We can simply rename them to regular files.
credit: some code is copied from @dhruvilshah3 's PR: #10388

Reviewers: Dhruvil Shah <dhruvil@confluent.io>, Jun Rao <junrao@gmail.com>
2021-06-29 09:17:13 -07:00
Rajini Sivaram c6d2778a8d
KAFKA-12996; Return OFFSET_OUT_OF_RANGE for fetchOffset < startOffset even for diverging epochs (#10930)
If fetchOffset < startOffset, we currently throw OffsetOutOfRangeException when attempting to read from the log in the regular case. But for diverging epochs, we return Errors.NONE with the new leader start offset, hwm etc.. ReplicaFetcherThread throws OffsetOutOfRangeException when processing responses with Errors.NONE if the leader's offsets in the response are out of range and this moves the partition to failed state. The PR adds a check for this case when processing fetch requests and throws OffsetOutOfRangeException regardless of epoch.

Reviewers: Luke Chen <showuon@gmail.com>, Nikhil Bhatia <rite2nikhil@gmail.com>, Guozhang Wang <wangguoz@gmail.com>
2021-06-29 08:49:36 -07:00
Bruno Cadonna dc6805df73
MINOR: Improve test of log messages for dropped records (#10920)
Reviewers: Luke Chen <showuon@gmail.com>,  Boyang Chen <boyang@apache.org>
2021-06-29 13:00:35 +02:00
Ignacio Acuña Frías d95c191945
KAFKA-12926: ConsumerGroupCommand's java.lang.NullPointerException at negative offsets while running kafka-consumer-groups.sh (#10858)
This patch fixes the `ConsumerGroupCommand` to correctly handle missing offsets, which are returned as `null` by the admin API.

Reviewers: David Jacot <djacot@confluent.io>
2021-06-29 09:00:56 +02:00
Jason Gustafson f86cb1d1da
KAFKA-12631; Implement `resign` API in `KafkaRaftClient` (#10913)
This patch adds an implementation of the `resign()` API which allows the controller to proactively resign leadership in case it encounters an unrecoverable situation. There was not a lot to do here because we already supported a `Resigned` state to facilitate graceful shutdown.

Reviewers: José Armando García Sancio <jsancio@users.noreply.github.com>, David Arthur <mumrah@gmail.com>
2021-06-28 18:00:19 -07:00
Juan Gonzalez-Zurita cfcabc368c
KAFKA-12718: SessionWindows are closed too early (#10824)
Session windows should not be close directly when "window end" time is reached, but "window close" time should be "window-end + gap + grace-period".

Reviewer: Matthias J. Sax <matthias@confluent.io>
2021-06-28 15:39:49 -07:00
Matthias J. Sax 2540b77769
KAFKA-12909: add missing tests (#10893)
Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>
2021-06-28 15:32:16 -07:00
Matthias J. Sax 670630ae5b
KAFKA-12951: restore must terminate for tx global topic (#10894)
Reviewers: Guozhang Wang <guozhang@confluent.io>, Luke Chen <showuon@gmail.com>, Gasparina Damien <d.gasparina@gmail.com>
2021-06-28 14:10:25 -07:00
Justine Olshan 397fa1f894
KAFKA-12976; Remove UNSUPPORTED_VERSION error from delete topics call (#10923)
Removed the condition to throw the error. Now we return UNKNOWN_TOPIC_ID which allows clients to retry instead of failing. Updated the test for IBP < 2.8 that tries to delete topics using ID.

Reviewers: Luke Chen <showuon@gmail.com>, Jason Gustafson <jason@confluent.io>
2021-06-28 10:15:50 -07:00
Luke Chen c96dc3aef7
KAFKA-12938: Fix and reenable testChrootExistsAndRootIsLocked test (#10916)
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Igor Soarez <soarez@apple.com>
2021-06-28 16:21:59 +05:30
dengziming bd1ee02b87
MINOR: Add missing apiversion test for 3.0 (#10748)
Reviewers: Luke Chen <showuon@gmail.com>, David Jacot <djacot@confluent.io>
2021-06-28 10:36:16 +02:00
阿洋 bc6873a61b
MINOR: To verify segment.hasOverflow, the path of the segment should be printed (#10925)
When refer to the return "Check whether the last offset of the last batch in this segment overflows the indexes", if the result is not expected, the path of the segment should be printed so that users can find problems.

Reviewers: Luke Chen, Guozhang Wang <wangguoz@gmail.com>
2021-06-27 20:32:06 -07:00