Commit Graph

9428 Commits

Author SHA1 Message Date
Jason Gustafson c1c639db77
KAFKA-13288; Include internal topics when searching hanging transactions (#11319)
This patch ensures that internal topics are included when searching for hanging transactions with the `--broker-id` argument in `kafka-transactions.sh`.

Reviewers: David Jacot <djacot@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2021-09-10 14:33:37 -07:00
Satish Duggana 1e19de3199
KAFKA-12988 Asynchronous API support for RemoteLogMetadataManager add/update methods. (#11033)
Added asynchronous API support for RemoeLogMetadataManager add/update/put methods.

Implemented the changes on default topic based RemoteLogMetadataManager.

Refactored the respective tests to cover the introduced asynchronous APIs.

Reviewers: Cong Ding <cong@ccding.com>, Jun Rao <junrao@gmail.com>
2021-09-09 10:06:25 -07:00
René Kerner df55c7ecff
KAFKA-13256: Fix NPE in ConfigDef when documentation is null (#11287)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Luke Chen <showuon@gmail.com>
2021-09-09 18:39:10 +02:00
Konstantine Karantasis 56928205bd
MINOR: Remove unsupported rsync and ssh commands from release.py (#11309)
ssh and rsync access has been removed from home.apache.org.
Removing the commands from release.py and replacing them with a note to make sure they are manually uploaded with an sftp client instead.

Reviewers: David Jacot <djacot@confluent.io>, Ismael Juma <ismael@juma.me.uk>
2021-09-08 13:28:07 -07:00
Tom Bentley 0a1df12382
KAFKA-13276: Prefer KafkaFuture in admin Result constructors (#11301)
Avoid using the non-public API KafkaFutureImpl in the Admin client's `*Result` class constructors.
This is particularly problematic for `DescribeConsumerGroupsResult` which currently has a
public constructor.  For the other classes the rationale is simply consistency with the majority of
the `*Result` classes.

Reviewers: Ismael Juma <ismael@juma.me.uk, David Jacot <djacot@confluent.io>, Luke Chen <showuon@gmail.com>
2021-09-08 12:15:44 -07:00
Josep Prat 286126f9a5
KAFKA-13243: KIP-773 Differentiate metric latency measured in ms and ns (#11302)
KAFKA-13243: KIP-773 Differentiate metric latency measured in ms and ns

Implementation of KIP-773

Deprecates inconsistent metrics bufferpool-wait-time-total,
io-waittime-total, and iotime-total.
Introduces new metrics bufferpool-wait-time-ns-total,
io-wait-time-ns-total, and io-time-ns-total with the same semantics as
before.
Adds metrics (old and new) in ops.html.
Adds upgrade guide for these metrics.

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Tom Bentley <tbentley@redhat.com>
2021-09-08 18:00:58 +01:00
David Jacot 5e3ecf192e
KAFKA-13237; Add ActiveBrokerCount and FencedBrokerCount metrics to the ZK controller (KIP-748) (#11273)
This patch adds the `ActiveBrokerCount` and the `FencedBrokerCount` metrics to the ZK controller. Note that `FencedBrokerCount` is always set to zero in the ZK controller.

Reviewers: Jason Gustafson <jason@confluent.io>
2021-09-08 18:44:29 +02:00
David Jacot 06e53afbef
KAFKA-13266; `InitialFetchState` should be created after partition is removed from the fetchers (#11294)
`ReplicationTest.test_replication_with_broker_failure` in KRaft mode sometimes fails with the following error in the log:

```
[2021-08-31 11:31:25,092] ERROR [ReplicaFetcher replicaId=1, leaderId=2, fetcherId=0] Unexpected error occurred while processing data for partition __consumer_offsets-1 at offset 31727 (kafka.server.ReplicaFetcherThread)java.lang.IllegalStateException: Offset mismatch for partition __consumer_offsets-1: fetched offset = 31727, log end offset = 31728. at kafka.server.ReplicaFetcherThread.processPartitionData(ReplicaFetcherThread.scala:194) at kafka.server.AbstractFetcherThread.$anonfun$processFetchRequest$8(AbstractFetcherThread.scala:545) at scala.Option.foreach(Option.scala:437) at kafka.server.AbstractFetcherThread.$anonfun$processFetchRequest$7(AbstractFetcherThread.scala:533) at kafka.server.AbstractFetcherThread.$anonfun$processFetchRequest$7$adapted(AbstractFetcherThread.scala:532) at kafka.utils.Implicits$MapExtensionMethods$.$anonfun$forKeyValue$1(Implicits.scala:62) at scala.collection.convert.JavaCollectionWrappers$JMapWrapperLike.foreachEntry(JavaCollectionWrappers.scala:359) at scala.collection.convert.JavaCollectionWrappers$JMapWrapperLike.foreachEntry$(JavaCollectionWrappers.scala:355) at scala.collection.convert.JavaCollectionWrappers$AbstractJMapWrapper.foreachEntry(JavaCollectionWrappers.scala:309) at kafka.server.AbstractFetcherThread.processFetchRequest(AbstractFetcherThread.scala:532) at kafka.server.AbstractFetcherThread.$anonfun$maybeFetch$3(AbstractFetcherThread.scala:216) at kafka.server.AbstractFetcherThread.$anonfun$maybeFetch$3$adapted(AbstractFetcherThread.scala:215) at scala.Option.foreach(Option.scala:437) at kafka.server.AbstractFetcherThread.maybeFetch(AbstractFetcherThread.scala:215) at kafka.server.AbstractFetcherThread.doWork(AbstractFetcherThread.scala:197) at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:99)[2021-08-31 11:31:25,093] WARN [ReplicaFetcher replicaId=1, leaderId=2, fetcherId=0] Partition __consumer_offsets-1 marked as failed (kafka.server.ReplicaFetcherThread)
```

The issue is due to a race condition in `ReplicaManager#applyLocalFollowersDelta`. The `InitialFetchState` is created and populated before the partition is removed from the fetcher threads. This means that the fetch offset of the `InitialFetchState` could be outdated when the fetcher threads are re-started because the fetcher threads could have incremented the log end offset in between.

The patch fixes the issue by removing the partitions from the replica fetcher threads before creating the `InitialFetchState` for them.

Reviewers: Jason Gustafson <jason@confluent.io>

### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation 
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
2021-09-08 18:23:37 +02:00
Tomer Wizman fb77da941a
KAFKA-12766 - Disabling WAL-related Options in RocksDB (#11250)
Description
Streams disables the write-ahead log (WAL) provided by RocksDB since it replicates the data in changelog topics. Hence, it does not make much sense to set WAL-related configs for RocksDB.

Proposed solution
Ignore any WAL-related configuration and state in the log that we are ignoring them.

Co-authored-by: Tomer Wizman <tomer.wizman@personetics.com>
Co-authored-by: Bruno Cadonna <cadonna@apache.org>

Reviewers: Boyang Chen <boyang@apache.org>, Bruno Cadonna <cadonna@apache.org>
2021-09-08 13:57:08 +02:00
Mickael Maison c56905bacc
KAFKA-13258/13259/13260: Fix error response generation (#11288)
AlterClientQuotas, DescribeProducers and FindCoordinator have issues when building error responses. This can lead to brokers returning responses without errors even when some have happened.

Reviewers: David Jacot <djacot@confluent.io>, Jason Gustafson <jason@confluent.io>, Luke Chen <showuon@gmail.com>
2021-09-08 11:16:23 +02:00
Christo Lolov 6472e79092
KAFKA-12994 Migrate JoinWindowsTest and SessionWindowsTest to new API (#11214)
As detailed in KAFKA-12994, unit tests using the old API should be either removed or migrated to the new API.
This PR migrates relevant tests in JoinWindowsTest.java and SessionWindowsTest.java.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2021-09-07 19:50:18 -07:00
Jorge Esteban Quilcate Otoya 5f89ce5f20
KAFKA-13201: Convert KTable suppress to new PAPI (#11213)
Migrate Suppress as part of the migration of KStream/KTable
 operations to the new Processor API (KAFKA-8410)

Reviewers: John Roesler <vvcephei@apache.org>
2021-09-07 17:17:44 -05:00
Weisheng Yang bc1800809d
MINOR: Supplement unit test for KAFKA-13175 (#11304)
Reviewers: Guozhang Wang <wangguoz@gmail.com>
2021-09-07 13:50:34 -07:00
Yanwen(Jason) Lin 66a27af2f1
KAFKA-10038: Supports default client.id for ConsoleConsumer, ProducerPerformance, ConsumerPerformance (#11297)
Reviewers: Guozhang Wang <wangguoz@gmail.com>
2021-09-07 13:49:50 -07:00
Rajini Sivaram 9d107c174b
KAFKA-13277; Fix size calculation for tagged string fields in message generator (#11308)
Reviewers: Colin P. McCabe <cmccabe@apache.org>
2021-09-07 13:02:45 -07:00
Ismael Juma 80635e4255
KAFKA-13262: Remove final from `MockConsumer.close()` and delegate implementation (#11307)
I added the final via 2f36001987 to catch overriding mistakes
since the implementation was moved from the deprecated and
overloaded `close` with two parameters to the no-arg
`close`.

I didn't realize then that `MockConsumer` is a public
API (seems like a bit of a mistake since we tweak the
implementation and sometimes adds methods without a KIP).

Given that this is a public API, I have also moved the implementation
of `close` to the one arg overload. This makes it easier for a
subclass to have specific overriding behavior depending on the
timeout.

Reviewers: David Jacot <djacot@confluent.io>
2021-09-07 12:06:03 -07:00
Ismael Juma 49f7c824fa
MINOR: Upgrade compression libraries (#11303)
lz4-java: 1.7.1 -> 1.8.0

The most noteworthy change is the upgrade of the
underlying C library to 1.9.3. Details:

* https://github.com/lz4/lz4-java/releases/tag/1.8.0
* https://github.com/lz4/lz4/releases/tag/v1.9.3

snappy-java: 1.1.8.1 -> 1.1.8.4

The most noteworthy change is support for Apple M1.
Details:

* https://github.com/xerial/snappy-java/releases/tag/1.1.8.2 
* https://github.com/xerial/snappy-java/releases/tag/1.1.8.3
* https://github.com/xerial/snappy-java/releases/tag/1.1.8.4

zstd-jni: 1.5.0-2 -> 1.5.0-4

Minor fixes, details:

* https://github.com/luben/zstd-jni/releases/tag/v1.5.0-3
* https://github.com/luben/zstd-jni/releases/tag/v1.5.0-4

Reviewers: David Jacot <djacot@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>, Luke Chen <showuon@gmail.com>, Josep Prat <josep.prat@aiven.io>
2021-09-07 08:46:21 -07:00
CHUN-HAO TANG 5193223389
KAFKA-13101: Replace EasyMock and PowerMock with Mockito for RestServerTest (#11074)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-09-06 11:20:38 -07:00
Ismael Juma 3475347aed
KAFKA-13270: Set JUTE_MAXBUFFER to 4 MB by default (#11295)
We restore the 3.4.x/3.5.x behavior unless the caller has set the property (note that ZKConfig
auto configures itself if certain system properties have been set).

I added a unit test that fails without the change and passes with it.

I also refactored the code to streamline the way we handle parameters passed to
KafkaZkClient and ZooKeeperClient.
 
See https://github.com/apache/zookeeper/pull/1129 for the details on why the behavior
changed in 3.6.0.

Credit to @rondagostino for finding and reporting this issue.

Reviewers: David Jacot <djacot@confluent.io>
2021-09-06 09:18:47 -07:00
Ismael Juma 0118330103
KAFKA-13273: Add support for Java 17 (#11296)
Java 17 is at release candidate stage and it will be a LTS release once
it's out (previous LTS release was Java 11).

Details:
* Replace Java 16 with Java 17 in Jenkins and Readme.
* Replace `--illegal-access=permit` (which was removed from Java 17)
   with  `--add-opens` for the packages we require internal access to.
   Filed KAFKA-13275 for updating the tests not to require `--add-opens`
   (where possible).
* Update `release.py` to use JDK8. and JDK 17 (instead of JDK 8 and JDK 15).
* Removed all but one Streams test from `testsToExclude`. The
   Connect test exclusion list remains the same.
* Add notable change to upgrade.html
* Upgrade to Gradle 7.2 as it's required for proper Java 17 support.
* Upgrade mockito to 3.12.4 for better Java 17 support.
* Adjusted `KafkaRaftClientTest` and `QuorumStateTest` not to require
   private access to `jdk.internal.util.random`.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2021-09-06 08:55:52 -07:00
CHUN-HAO TANG 81667e2bf5
KAFKA-13066: Replace EasyMock with Mockito for FileStreamSinkConnectorTest (#11027)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-09-06 08:22:34 -07:00
CHUN-HAO TANG 89ee72b5b5
KAFKA-13088: Replace EasyMock with Mockito for ForwardingDisabledProcessorContextTest (#11051)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-09-06 08:18:52 -07:00
Yanwen(Jason) Lin 7c64077b34
KAFKA-13032: add NPE checker for KeyValueMapper (#11241)
Currently KStreamMap and KStreamFlatMap classes will throw NPE if the call to KeyValueMapper#apply() return null. This commit checks whether the result of KeyValueMapper#apply() is null and throws a more meaningful error message for better debugging.

Two unit tests are also added to check if we successfully captured nulls.

Reviewers: Josep Prat <josep.prat@aiven.io>,  Luke Chen <showuon@gmail.com>, Bruno Cadonna <cadonna@apache.org>
2021-09-06 14:03:16 +02:00
Luke Chen 37584ce4f5
KAFKA-13103: add REBALANCE_IN_PROGRESS error as retriable error for AlterConsumerGroupOffsetsHandler (#11086)
This patch adds `REBALANCE_IN_PROGRESS` error as retriable error for `AlterConsumerGroupOffsetsHandler`, and tests for it.

Reviewers: David Jacot <djacot@confluent.io>
2021-09-03 20:29:44 +02:00
David Mao 3c0b89d9df
KAFKA-13225: Controller skips sending UpdateMetadataRequest when no change in partition state. (#11255)
The controller can skip sending updateMetadataRequest during the broker failure callback if there are offline partitions and the deleted brokers don't host any partitions.

Reviewers: Jun Rao <junrao@gmail.com>
2021-09-02 13:44:12 -07:00
Andras Katona 0093b19e2e
KAFKA-9747: Creating connect reconfiguration URL safely (#11174)
* URL wasn't urlencoded when forwarded reconfiguration to leader connect worker
* handling previously swallowed errors in connect RestClient

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Viktor Somogyi-Vass <viktorsomogyi@gmail.com>

Co-authored-by: Andras Katona  <akatona@cloudera.com>
Co-authored-by: Daniel Urban <durban@cloudera.com>
2021-09-02 10:09:55 +02:00
Weisheng Yang 1a33b65e0f
KAFKA-13175; Optimization TopicExistsException,When a topic is marked for deletion. (#11226)
After a topic is deleted, the topic is marked for deletion, create topic with the same name throw exception topic already exists. It should indicate the topic is marked for deletion.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2021-09-01 10:16:41 -07:00
Josep Prat 4835c64f89
KAFKA-12887 Skip some RuntimeExceptions from exception handler (#11228)
Instead of letting all RuntimeExceptions go through and be processed by the uncaught exception handler, IllegalStateException and IllegalArgumentException are not passed through and fail fast. In this PR when setting the uncaught exception handler we check if the exception is in an "exclude list", if so, we terminate the client, otherwise we continue as usual.

Added test checking this new case. Added integration test checking that user defined exception handler is not used when an IllegalStateException is thrown.

Reviewers: Bruno Cadonna <cadonna@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2021-09-01 09:58:36 -07:00
Jason Gustafson 25b0857bdb
KAFKA-13234; Transaction system test should clear URPs after broker restarts (#11267)
Clearing under-replicated-partitions helps ensure that partitions do not become unavailable longer than necessary as brokers are rolled. This prevents flakiness due to transaction timeouts.

Reviewers: Luke Chen <showuon@gmail.com>, Ismael Juma <ismael@juma.me.uk>
2021-09-01 08:37:05 -07:00
Rohan a5ce43781e
MINOR: add units to metrics descriptions + test fix post KAFKA-13229 (#11286)
Reviewers: Guozhang Wang <wangguoz@gmail.com>
2021-08-31 11:44:45 -07:00
Rohan 01ab888dbd
KAFKA-13229: add total blocked time metric to streams (KIP-761) (#11149)
* Add the following producer metrics:
flush-time-total: cumulative sum of time elapsed during in flush.
txn-init-time-total: cumulative sum of time elapsed during in initTransactions.
txn-begin-time-total: cumulative sum of time elapsed during in beginTransaction.
txn-send-offsets-time-total: cumulative sum of time elapsed during in sendOffsetsToTransaction.
txn-commit-time-total: cumulative sum of time elapsed during in commitTransaction.
txn-abort-time-total: cumulative sum of time elapsed during in abortTransaction.

* Add the following consumer metrics:
commited-time-total: cumulative sum of time elapsed during in committed.
commit-sync-time-total: cumulative sum of time elapsed during in commitSync.

* Add a total-blocked-time metric to streams that is the sum of:
consumer’s io-waittime-total
consumer’s iotime-total
consumer’s committed-time-total
consumer’s commit-sync-time-total
restore consumer’s io-waittime-total
restore consumer’s iotime-total
admin client’s io-waittime-total
admin client’s iotime-total
producer’s bufferpool-wait-time-total
producer's flush-time-total
producer's txn-init-time-total
producer's txn-begin-time-total
producer's txn-send-offsets-time-total
producer's txn-commit-time-total
producer's txn-abort-time-total

Reviewers: Bruno Cadonna <cadonna@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2021-08-30 15:39:25 -07:00
Satish Duggana 923bc2e9f7
MINOR Refactored the existing CheckpointFile in core module, moved to server-common module and introduced it as SnapshotFile. (#11060)
MINOR Refactored the existing CheckpointFile in core module, moved to server-common module.

Refactored CheckpointFile to server-common module as a Java class and it is reused by LeaderCheckpointFile, OffsetCheckpointFile.
This will be used by CommittedOffsetsFile which checkpoints remote log metadata partitions with respective offsets in the default RemoteLogMetadataManager implementation.
Existing tests are available for LeaderCheckpointFile, OffsetCheckpointFile.

Reviewers: Jun Rao <junrao@gmail.com>
2021-08-30 08:43:25 -07:00
dengziming 1d22b0d706
KAFKA-10774; Admin API for Describe topic using topic IDs (#9769)
Reviewers: Justine Olshan <jolshan@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>, Satish Duggana <satishd@apache.org>, Rajini Sivaram <rajinisivaram@googlemail.com>
2021-08-28 09:00:36 +01:00
Walker Carlson 49aed781d8
KAFKA-13128: extract retry checker and update with retriable exception causing flaky StoreQueryIntegrationTest (#11275)
Add a new case to the list of possible retriable exceptions for the flaky tests to take care of threads starting up

Reviewers: Leah Thomas <lthomas@confluent.io>, Anna Sophie Blee-Goldman
2021-08-27 20:12:12 -07:00
Andy Lapidas 84b111f968
KAFKA-12963: Add processor name to error (#11262)
This PR adds the processor name to the ClassCastException exception text in process()

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2021-08-27 20:06:49 -07:00
Cong Ding 555f709175
MINOR: move tiered storage related configs to a separate class within LogConfig (#11110)
The original code uses a RemoteLogManagerConfig class to store KIP-405 configs and adds three configs to LogConfig. This makes the code complicated and developers may be confused.

This PR allows us to access RemoteLogManagerConfig from KafkaConfig and do the same for LogConfig. Kafka developers will see the same interface for the KIP-405 configs. After this change, if we want to read remoteStorageEnable we should use LogConfig.tieredLogConfig.remoteStorageEnable instead of LogConfig.remoteStorageEnable. The same for localRetentionMs and localRetentionBytes. If we want to read configs in RemoteLogManagerConfig, we should use KafkaConfig.tieredKafkaConfig.xxx.

Reviewers: Satish Duggana <satishd@apache.org>, Kowshik Prakasam <kprakasam@confluent.io>, Jun Rao <junrao@gmail.com>
2021-08-27 11:10:58 -07:00
Jason Gustafson ba47beec01
MINOR: Ensure transactional message copier failures are logged (#11268)
This patch has a couple small improvements to `TransactionalMessageCopier` logging:

- Log all fatal exceptions which cause the copier to shutdown unexpectedly
- Log all non-fatal exceptions which cause the copier to abort a transaction

Reviewers: David Jacot <djacot@confluent.io>
2021-08-27 11:02:47 -07:00
Justine Olshan 7201976378
KAFKA-13079: Forgotten Topics in Fetch Requests may incorrectly use topic IDs (#11104)
The FetchSessionHandler had a small bug in the session build method where we did not consider building a session where no partitions were added and the session previously did not use topic IDs. (ie, it was relying on at least one partition being added to signify whether topic IDs were present)

Due to this, we could send forgotten partitions with the zero UUID. This would always result in an exception and closed session.

This patch fixes the logic to check that any forgotten partitions have topic IDs. There is also a test added for the empty session situation when topic IDs are used and when topic names are used.

Reviewers: David Jacot <djacot@confluent.io>, Jun Rao <junrao@gmail.com>
2021-08-27 18:28:21 +02:00
David Arthur edd5a249e9
KAFKA-13233 Log zkVersion in more places (#11266)
When debugging issues with partition state, it's very useful to know the zkVersion that was written. This patch adds the zkVersion of LeaderAndIsr in a few more places.
2021-08-27 11:19:58 -04:00
David Jacot 4e2f2b0674
MINOR: Update `TransactionalMessageCopier` to use the latest transaction pattern (#11265)
Reviewers: Jason Gustafson <jason@confluent.io>
2021-08-27 11:11:57 +02:00
David Jacot c4e1e23857
KAFKA-13231; `TransactionalMessageCopier.start_node` should wait until the process if fully started (#11264)
This patch ensures that the transaction message copier is fully started in `start_node`. Without this, it is possible that `stop_node` is called before the process is started which results in not stopping it at all.

Reviewers: Jason Gustafson <jason@confluent.io>
2021-08-27 08:28:14 +02:00
David Jacot 8d5185d976
MINOR; Small optimizations in `ReplicaManager#becomeLeaderOrFollower` (#11225)
This patch refactors `ReplicaManager#becomeLeaderOrFollower` to avoid having to re-iterate over all the partitions to determine which ones should become leaders and which ones should become followers.

The patch also refactors how partitions are marked as offline when the log can't be created. Before the patch, we were iterating over all the partitions in the request or in the delta to mark them as offline is the log was not present. Now, we mark them as failed directly if the log can not be created.

Reviewers: Luke Chen <showuon@gmail.com>, Jason Gustafson <jason@confluent.io>
2021-08-27 08:22:36 +02:00
A. Sophie Blee-Goldman d9bb988954
MINOR: remove unused Properties from GraphNode#writeToTopology (#11263)
The GraphNode#writeToTopology method accepts a Properties input parameter, but never uses it in any of its implementations. We can remove this parameter to clean things up and help make it clear that writing nodes to the topology doesn't involve the app properties.

Reviewers: Bruno Cadonna <cadonna@confluent.io>
2021-08-26 17:19:03 -07:00
Luke Chen 844c1259a9
MINOR: Optimize the OrderedBytes#upperRange for not all query cases (#11181)
Currently in OrderedBytes#upperRange method, we'll check key bytes 1 by 1, to see if there's a byte value >= first timestamp byte value, so that we can skip the following key bytes, because we know compareTo will always return 0 or 1. However, in most cases, the first timestamp byte is always 0, more specifically the upperRange is called for both window store and session store. For former, the suffix is in timestamp, Long.MAX_VALUE and for latter the suffix is in Long.MAX_VALUE, timestamp. For Long.MAX_VALUE the first digit is not 0, for timestamp it could be 0 or not, but as long as it is up to "now" (i.e. Aug. 23rd) then the first byte should be 0 since the value is far smaller than what a long typed value could have. So in practice for window stores, that suffix's first byte has a large chance to be 0, and hence worth optimizing for.

This PR optimizes the not all query cases by not checking the key byte 1 by 1 (because we know the unsigned integer will always be >= 0), instead, put all bytes and timestamp directly. So, we won't have byte array copy in the end either.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2021-08-26 14:37:34 -07:00
Kowshik Prakasam 1d3b96389b
MINOR: Improve local variable name in UnifiedLog.maybeIncrementFirstUnstableOffset (#11253)
Reviewers: Jun Rao <junrao@gmail.com>
2021-08-26 13:27:51 -07:00
A. Sophie Blee-Goldman 53277a92a6
HOTFIX: decrease session timeout in flaky NamedTopologyIntegrationTest (#11259)
Decrease session timeout back to 10s to improve test flakiness

Reviewers: Walker Carlson <wcarlson@confluent.io>
2021-08-25 21:52:32 -07:00
Konstantine Karantasis 735b10e3cb
MINOR: Add missing license entry for jline in LICENSE-binary (#11260)
Adding the license for https://github.com/jline/jline3 
This is a commit that was missed when https://github.com/apache/kafka/pull/11232 was merged. 

Reviewers: Konstantine Karantasis <k.karantasis@gmail.com>
2021-08-25 19:13:22 -07:00
Jason Gustafson d0ec4d7ebf
KAFKA-13214; Consumer should not reset state after retriable error in rebalance (#11231)
Currently the consumer will reset state after any retriable error during a rebalance. This includes coordinator disconnects as well as coordinator changes. The impact of this is that rebalances get delayed since they will be blocked until the session timeout of the old memberId expires. 

The patch here fixes the problem by not resetting the member state after a retriable error.

Reviewers: David Jacot <djacot@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2021-08-24 11:59:38 -07:00
Jason Gustafson d30b4e5151
MINOR: Improve controlled shutdown logging (#11246)
A few small logging improvements:
- Only print error when it is not NONE
- Full list of remaining partitions are printed only at debug level
- Only backoff and print retry logging if there are remaining retries

Reviewers: Luke Chen <showuon@gmail.com>, David Jacot <djacot@confluent.io>
2021-08-24 09:22:58 -07:00
David Mao 7298aa3734
KAFKA-13134: Give up group metadata lock before sending heartbeat response (#11127)
Small locking improvement to drop the group metadata lock before invoking the response callback in `GroupCoordinator#handleHeartbeat`.

Reviewers: David Jacot <djacot@confluent.io>
2021-08-24 12:07:11 +02:00