Commit Graph

13582 Commits

Author SHA1 Message Date
Sebastien Viale c8dc09c265 KAFKA-16448: Handle fatal user exception during processing error (#16675)
This PR is part of KIP-1033 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR catch the exceptions thrown while handling a processing exception

Co-authored-by: Dabz <d.gasparina@gmail.com>
Co-authored-by: loicgreffier <loic.greffier@michelin.com>

Reviewers: Bruno Cadonna <bruno@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-07-30 22:57:31 -07:00
Josep Prat 0370a6464b
MINOR: Add text and link to blog in announcement template email (#16734)
Reviewers: Igor Soarez <soarez@apple.com>
2024-07-30 21:50:31 +02:00
Josep Prat 3d2ea547d8
KAFKA-17214: Add 3.8.0 version to core and client system tests (#16726)
Reviewers: Greg Harris <greg.harris@aiven.io>
2024-07-30 19:42:12 +02:00
Josep Prat b8c54c3f38
KAFKA-17214: Add 3.8.0 version to streams system tests (#16728)
* KAFKA-17214: Add 3.8.0 version to streams system tests

Reviewers: Bill Bejeck <bbejeck@gmail.com>
2024-07-30 19:41:36 +02:00
PaulRMellor 0969789973 KAFKA-15469: Add documentation for configuration providers (#16650)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2024-07-30 15:35:40 +02:00
Josep Prat bc243ab1e8
MINOR: Add 3.8.0 to system tests (#16714)
Reviewers:  Manikumar Reddy <manikumar.reddy@gmail.com>
2024-07-30 09:20:35 +02:00
Matthias J. Sax b8532070f7 HOTFIX: fix compilation error 2024-07-29 21:08:49 -07:00
Sebastien Viale 10d9f7872d KAFKA-16448: Add ErrorHandlerContext in deserialization exception handler (#16432)
This PR is part of KIP1033 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR expose the new ErrorHandlerContext as a parameter to the Deserialization exception handlers and deprecate the previous handle signature.

Co-authored-by: Dabz <d.gasparina@gmail.com>
Co-authored-by: loicgreffier <loic.greffier@michelin.com>

Reviewers: Bruno Cadonna <bruno@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-07-29 20:35:25 -07:00
Sebastien Viale a4ea9aec73 KAFKA-16448: Add ErrorHandlerContext in production exception handler (#16433)
This PR is part of KIP-1033 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR expose the new ErrorHandlerContext as a parameter to the Production exception handler and deprecate the previous handle signature.

Co-authored-by: Dabz <d.gasparina@gmail.com>
Co-authored-by: loicgreffier <loic.greffier@michelin.com>

Reviewers: Bruno Cadonna <bruno@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-07-29 20:35:17 -07:00
Colin P. McCabe f26f0b6626 tests/kafkatest/version.py: Add 3.9.0 as DEV_VERSION 2024-07-29 15:58:04 -07:00
Abhinav Dixit 6ff51bc388
KAFKA-17210: Broker fixes for smooth concurrent fetches on share partition (#16711)
Identified a couple of reliability issues with broker code for share groups 

1. Broker seems to get stuck at times when using multiple share consumers due to a corner case where the second last fetch request did not contain any topic partition to fetch, because of which the broker could never complete the last request. This results in a share fetch request getting stuck.

2. Since persister would not perform any business logic around sending state batches for a share partition, there could be scenarios where it sends state batches with no AVAILABLE records. This could cause a breach on the limit of in-flight messages we have configured, and hence broker would never be able to complete the share fetch requests.

Reviewers:  Andrew Schofield <aschofield@confluent.io>, Apoorv Mittal <apoorvmittal10@gmail.com>,  Manikumar Reddy <manikumar.reddy@gmail.com>
2024-07-30 01:16:58 +05:30
Matthias J. Sax b6c1cb0eec
MINOR: update CachingPersistentWindowStoreTest (#16701)
Refactor test to move off deprecated `transform()` in favor of
`process()`.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-07-29 12:45:13 -07:00
Alyssa Huang 2cf87bff9b
KAFKA-16953; Properly implement the sending of DescribeQuorumResponse (#16637)
This change allows the KRaft leader to send the DescribeQuorumResponse version based on the schema version used by the client.

Reviewers: José Armando García Sancio <jsancio@apache.org>
2024-07-29 14:36:17 -04:00
TengYao Chi b348b556be
KAFKA-17202 surround consumer with try-resource statement (#16702)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-30 01:06:11 +08:00
Chris Egerton 61f61d6240
KAFKA-14569: Migrate Connect's integration test EmbeddedKafkaCluster from ZK to KRaft mode (#16599)
Reviewers: Omnia Ibrahim <o.g.h.ibrahim@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-29 10:43:55 -04:00
Kirk True d260b06180
KAFKA-17060 Rename LegacyKafkaConsumer to ClassicKafkaConsumer (#16683)
Reviewers: Andrew Schofield <aschofield@confluent.io>, Lianet Magrans <lianetmr@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-29 20:56:23 +08:00
Dmitry Werner 4e69bc09e6
KAFKA-17194 Don't create cluster for MetadataQuorumCommandTest#testCommandConfig (#16682)
Reviewers: TengYao Chi <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-29 18:48:00 +08:00
Chia Chuan Yu fdee225a1b
KAFKA-17177 reviewers.py should grep "authors" to offer more candidates of reviewers information (#16674)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-29 18:36:35 +08:00
Alyssa Huang da8fe6355b
KAFKA-16915; LeaderChangeMessage supports directory id (#16668)
Extend LeaderChangeMessage schema to support version 1 of the message. The leader will continue to write version 0 of the schema. This is needed so that in the future the leader can write version 1 of the message and be guaranteed that all of the replicas in the cluster support version 1 of the schema.

Reviewers: José Armando García Sancio <jsancio@apache.org>
2024-07-28 11:12:42 -04:00
José Armando García Sancio da32dcab2c
KAKFA-16537; Implement remove voter RPC (#16670)
Implement the RemoveVoter RPC. The general algorithm is as follow:

1. Check that the leader has fenced the previous leader(s) by checking that the HWM is known;
  otherwise return the REQUEST_TIMED_OUT error.
2. Check that the cluster supports kraft.version 1; otherwise return the UNSUPPORTED_VERSION error.
3. Check that there are no uncommitted voter changes; otherwise return the REQUEST_TIMED_OUT error.
4. Append the updated VotersRecord to the log. The KRaft internal listener will read this uncommitted
  record from the log and add the new voter to the set of voters.
5. Wait for the VotersRecord to commit using the majority of the new set of voters. Return a 
  REQUEST_TIMED_OUT error if it doesn't commit in time.
6. Send the RemoveVoter successful response to the client.
7. Resign the leadership if the leader is not in the new voter set

One thing to note is that now that KRaft supports both the remove voter and add voter RPC. Only one
change can be pending at once. This is achieved in the following ways. The AddVoter RPC checks if
there are pending AddVoter or RemoveVoter RPC. The RemoveVoter RPC checks if there are any
pending AddVoter or RemoveVoter RPC. Both RPCs check that there is no uncommitted VotersRecord.

Reviewers: Colin P. McCabe <cmccabe@apache.org>
2024-07-26 16:25:41 -07:00
Justine Olshan a0f6e6f816
KAFKA-16192: Introduce transaction.version and usage of flexible records to coordinators (#16183)
This change includes adding transaction.version (part of KIP-1022)

New transaction version 1 is introduced to support writing flexible fields in transaction state log messages.

Transaction version 2 is created in anticipation for further KIP-890 changes.

Neither are made production ready. Tests for the new transaction version and new MV are created.

Also include change to not report a feature as supported if the range is 0-0.

Reviewers: Jun Rao <junrao@apache.org>, David Jacot <djacot@confluent.io>, Artem Livshits <alivshits@confluent.io>, Colin P. McCabe <cmccabe@apache.org>
2024-07-26 11:38:44 -07:00
TengYao Chi a07294a732
KAFKA-17204: KafkaStreamsCloseOptionsIntegrationTest.before leaks AdminClient (#16692)
To avoid a resource leak, we need to close the AdminClient after the test.

Reviewers: Lianet Magrans <lianetmr@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2024-07-26 10:32:39 -07:00
PaulRMellor 738d8cc91e
MINOR: Update bootstrap.servers doc string (#16655)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2024-07-26 15:08:01 +02:00
Josep Prat 93068264a1
MINOR: Fix title in upgrade header (#16654)
* MINOR: Fix title in upgrade header
* Add message in noticeable changes

Reviewers:  Chia-Ping Tsai <chia7712@gmail.com>
2024-07-26 11:04:03 +02:00
Sebastien Viale 09be14bb09
KAFKA-16448: Fix processing exception handler (#16663)
Co-authored-by: Dabz <d.gasparina@gmail.com>
Co-authored-by: loicgreffier <loic.greffier@michelin.com>

Minor code improvements across different classed, related to the `ProcessingExceptionHandler` implementation (KIP-1033).

Reviewers: Bruno Cadonna <bruno@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-07-25 16:17:31 -07:00
brenden20 41beee508e
KAFKA-16558: Implemented HeartbeatRequestState toStringBase() and added a test for it (#16373)
Reviewers: Kirk True <kirk@kirktrue.pro>, Matthias J. Sax <matthias@confluent.io>
2024-07-25 13:27:17 -07:00
Ken Huang ee03c5f98a
KAFKA-17195 remove generated code path from test scrope of sourceSets (#16688)
The generated code path added to test scope of sourceSets will make `Gradle` assume there are tests in module, and then it results in failed test task since the module does not define test engine.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-25 18:43:46 +08:00
Kuan-Po Tseng 437b86cd20
KAFKA-17176 Move FileLock to server-common module (#16671)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-25 14:24:27 +08:00
brenden20 cca0390822
KAFKA-15999 Migrate HeartbeatRequestManagerTest away from ConsumerTestBuilder (#16200)
In this PR I have completely migrated HeartbeatRequestManagerTest away from ConsumerTestBuilder. I have removed any instances of spy objects and used mocks wherever possible. 31/31 tests are passing. I also removed one test that existed in another test file.

Reviewers: Lianet Magrans <lianetmr@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-25 14:12:51 +08:00
Zhengke Zhou a38829e61b
KAFKA-16765: Close leaked accepted sockets in EchoServer, NioEchoServer, ServerShutdownTest (#16576)
Reviewers: Greg Harris <greg.harris@aiven.io>
2024-07-24 10:20:51 -07:00
Ken Huang ee68f3215f
KAFKA-16666 Migrate `TransactionLogMessageFormatter` to tools module (#16019)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-25 00:42:25 +08:00
Dmitry Werner 3e2de237be
KAFKA-17021 Migrate AclCommandTest to new test infra (#16500)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-25 00:12:47 +08:00
Josep Prat ba3119fcfa
MINOR: Update collaborators list (#16679)
* MINOR: Update collaborators list using GH contributors page

Reviewers:  Chia-Ping Tsai <chia7712@gmail.com>, Omnia Ibrahim <o.g.h.ibrahim@gmail.com>
2024-07-24 18:08:30 +02:00
PoAn Yang a6b9407607
MINOR: add comment for correctness issue to LeaderEpochFileCache (#16660)
Reviewers: Jun Rao <junrao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-24 23:00:41 +08:00
Logan Zhu 3589f45656
MINOR: Replace lambda expressions with method references for ReplicationControlManager (#16547)
Reviewers: Xuan-Zhang Gong <gongxuanzhangmelt@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-24 19:44:54 +08:00
Chung, Ming-Yen baedfc7e04
KAFKA-17160 Determine mockitoArtifactName based on mockitoVersion instead of JavaVersion (#16639)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-24 19:39:40 +08:00
Chung, Ming-Yen 253b36113d
KAFKA-17179 Remove integration tag in class level when using ClusterTestExtensions (#16656)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-24 19:29:34 +08:00
TaiJuWu 4fa1c21940
KAFKA-17104 InvalidMessageCrcRecordsPerSec is not updated in validating LegacyRecord (#16558)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-24 19:25:11 +08:00
Kamal Chandraprakash 539f466ccb
KAFKA-17168 Remove the logPrefix to print the thread name (#16657)
Reviewers: Kuan-Po (Cooper) Tseng <brandboat@gmail.com>, Satish Duggana <satishd@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-24 16:54:02 +08:00
TaiJuWu f9f480ac7c
KAFKA-17163 revisit testSubscriptionOnInvalidTopic and testPollAuthenticationFailure (#16638)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-24 16:40:35 +08:00
dujian0068 7efb58f321
KAFKA-16584 Make log processing summary configurable or debug (#16509)
KAFKA-16584 Make log processing summary configurable or debug

Reviewers: Matthias Sax <mjsax@apache.org>, Bill Bejeck <bbejeck@apache.org>
2024-07-23 16:09:25 -04:00
Chris Egerton d43806c7f3
MINOR: Clarify ACL requirements for Connect workers when exactly.once.source.support is set to preparing (#16636)
Reviewers: Mickael Maison <mickael.maison@gmail.com>,
2024-07-23 13:15:54 -04:00
Chris Egerton 956d740c46
KAFKA-16068: Use TestPlugins mechanism in ConnectorValidationIntegrationTest to prevent ERROR-level log spam in unrelated test suites (#16647)
Reviewers: Greg Harris <greg.harris@aiven.io>
2024-07-23 13:15:03 -04:00
Mickael Maison c71eb60a3b
MINOR: Extract SockerServer inner classes to server module (#16632)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-23 20:19:41 +08:00
Ken Huang a012af5fb4
KAFKA-17149 Move ProducerStateManagerTest to storage module (#16645)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-23 20:08:08 +08:00
PoAn Yang a5bfc2190c
KAFKA-16791 Add thread detection to ClusterTestExtensions (#16499)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-23 11:16:31 +08:00
José Armando García Sancio 9db5c2481f KAFKA-16535; Implement KRaft add voter handling
This change implements the AddVoter RPC. The high-level algorithm is as follow:

1. Check that the leader has fenced the previous leader(s) by checking that the HWM is known;
   otherwise, return the REQUEST_TIMED_OUT error.
2. Check that the cluster supports kraft.version 1; otherwise return the UNSUPPORTED_VERSION error.
3. Check that there are no uncommitted voter changes; otherwise return the REQUEST_TIMED_OUT error.
4. Check that the new voter's id is not part of the existing voter set, otherwise return the
   DUPLICATE_VOTER error.
5. Send an API_VERSIONS RPC to the first (default) listener to discover the supported kraft.version
   of the new voter.
6. Check that the new voter supports the current kraft.version, otherwise return the
   INVALID_REQUEST error.
7. Check that the new voter is caught up to the log end offset of the leader, otherwise return a
   REQUEST_TIMED_OUT error.
8. Append the updated VotersRecord to the log. The KRaft internal listener will read this
   uncommitted record from the log and add the new voter to the set of voters.
9.  Wait for the VotersRecord to commit using the majority of the new set of voters. Return a
    REQUEST_TIMED_OUT error if it doesn't commit in time.
10. Send the AddVoter successful response to the client.

The leader implements the above algorithm by tracking 3 events: the ADD_VOTER request is received,
the API_VERSIONS response is received and finally the HWM is updated.

The state of the ADD_VOTER operation is tracked by LeaderState using the AddVoterHandlerState. The
algorithm is implemented by the AddVoterHandler type.

This change also fixes a small issue introduced by the bootstrap checkpoint (0-0.checkpoint). The
internal partition listener (KRaftControlRecordStateMachine) and the external partition listener
(KafkaRaftClient.ListenerContext) were using "nextOffset = 0" as the initial state of the reading
cursor. This was causing the bootstrap checkpoint to keep getting reloaded until the leader wrote a
record to the log. Changing the initial offset (nextOffset) to -1 allows the listeners to
distinguish between the initial state (nextOffset == -1) and the bootstrap checkpoint was loaded
but the log segment is empty (nextOffset == 0).

Reviewers: Colin P. McCabe <cmccabe@apache.org>
2024-07-22 13:07:38 -07:00
PoAn Yang f48e764f7e
KAFKA-17159 Make sure kafka-cluster-test-kit-executor get down when closing KafkaClusterTestKit (#16633)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-23 01:47:53 +08:00
Mickael Maison 98979e7384
MINOR: Move a few configs to SocketServerConfigs (#16634)
Move queued.max.requests, queued.max.request.bytes and num.network.threads to SocketServerConfigs

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-22 19:21:59 +02:00
PoAn Yang 44a44b753f
KAFKA-17166 Use NoOpScheduler to rewrite LogManagerTest#testLogRecoveryMetrics (#16641)
Reviewers: Okada Haruki <ocadaruma@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-22 22:05:50 +08:00