8000 chore(inkless:sync) upstream Apache Kafka 2026-11-23 (4.4 cut) by gqmelo · Pull Request #897 · aiven/inkless · GitHub
[go: up one dir, main page]

Skip to content

chore(inkless:sync) upstream Apache Kafka 2026-11-23 (4.4 cut) - #897

Merged
jeqo merged 851 commits into
mainfrom
sync/upstream-20261123
Dec 1, 2026
Merged

jeqo merged 851 commits into
mainfrom
sync/upstream-20261123

Conversation

@gqmelo
@gqmelo gqmelo commented Nov 25, 2026 •
Copy link
Copy Markdown
Collaborator

Sync main with Apache Kafka trunk up to 3afec2a52d, the commit where apache/4.4 branches off trunk (main-sync.sh --before-version 4.4). This merges 836 upstream commits and moves the version to 4.4.0-inkless-SNAPSHOT. The next step creates inkless-4.4 from main.

Land with Create a merge commit. Squash or rebase would break the merge base that the next sync reads.

Commits

The branch starts from the current main and has one upstream merge commit, followed by the adaptations:

  1. merge: apache/kafka trunk 3afec2a52d (before 4.4 branch): the 50 conflicted files (about 95 hunks) needed manual resolution.
  2. sync(compile): adapt build and main sources to upstream 4.4 refactors
  3. sync(compile): pass upstream 4.4 build checks
  4. sync(test): adapt tests to upstream 4.4 test API changes
  5. sync(test): fix inkless unit tests for upstream 4.4 behavior
  6. sync(test): bump tiered-storage-for-apache-kafka to 1.2.1
  7. sync(compile): build MetadataDelta through its builder in the inkless benchmark
  8. sync(test): adapt the #896 test to the Java LogManager
  9. fix(inkless:build): skip jOOQ generation in make docs
  10. sync(test): pass `forwarded` in the #899 and #905 tests
  11. sync(verify): add the session log for the 4.4 cut sync
  12. Merge remote-tracking branch 'origin/main' into sync/upstream-20261123: brings in ci: add Dependabot for the inkless module dependencies #913.
  13. Merge branch 'main' into sync/upstream-20261123: brings in fix(inkless:control-plane): guard against stale PostgreSQL standby reads [KC-859] #906.
  14. sync(test): adapt the #906 test to the removed LogTestUtils
  15. sync(verify): update the session log for the #913 and #906 merges

#896, 8000 #899, #905, and #906 merged into main while this PR was open. Their tests use APIs that upstream 4.4 changes, so commits 8, 10, and 14 adapt them. #913 and #906 came in after the branch was rebuilt on main, each through its own merge commit.

Review focus

  • ConfigurationControlManager: upstream added a forwarded flag to the alter-config paths. Git's auto-merge dropped it in the overloads that delegate to the inkless postConfigValidation hook. The flag is now threaded through, and QuorumController passes both.
  • ControllerApis: the inkless handlers use the new org.apache.kafka.network.Request type.
  • KafkaConfig: quotaConfig and the log getters moved to the Java AbstractKafkaConfig. logDisklessEnable stays in KafkaConfig.
  • KIP-1265 public API checker: AlterDisklessSwitchOptions, AlterDisklessSwitchResult, and DescribeTopicPartitionsResult have @InterfaceAudience.Public. DescribeTopicPartitionsResult exposes the raw protocol response by design. Its constructor and rawResponse have @SuppressKafkaInternalApiUsage.
  • checkstyle/suppressions.xml: RemoteLogManager.java joins the MethodLength suppression. Upstream's new remote-storage seed call plus the inkless reclaim floor push cleanupExpiredRemoteLogSegments to 174 lines.
  • Tiered storage plugin: 1.0.0 references org.apache.kafka.common.utils.ByteBufferInputStream, which Kafka 4.4 moved to utils.internals. The remote storage manager then fails at broker startup. Release 1.2.1 supports Kafka 4.4. Its io.confluent dependencies (Iceberg support) aren't on Maven Central. The core test dependencies on the plugin exclude them.
  • make docs skips generateJooqClasses: upstream's new :api-checker included build compiles its plugin with the running JDK, so CI's switch from JDK 25 to JDK 17 changes the task classpath. Gradle then reruns the jOOQ generation in the docs step. JDK 17 drops the "this-escape" warning from the generated annotations and leaves the committed sources dirty. CI still checks the jOOQ sources in its own JDK 25 step.
  • .github/dependabot.yml: upstream 4.4 and ci: add Dependabot for the inkless module dependencies #913 both add the file. It keeps the inkless Gradle entry and upstream's github-actions entry. The upstream entry has open-pull-requests-limit: 0, which stops GitHub Actions version-update PRs, and cooldown.default-days, because upstream's cooldown.default isn't in Dependabot's schema.
  • Tests deleted by upstream: PlaintextConsumerTest.scala keeps only the inkless testOffsetRelatedWhenTimeoutZero, which also runs on diskless topics. This PR deletes AbstractCreateTopicsRequestTest.scala, because upstream rewrote it in Java and the inkless change was only a timeout bump.
  • KafkaAdminClientTest: upstream split the class, so the inkless describeTopicPartitions tests moved to KafkaAdminClientTopicTest.

The rest follows upstream package moves: common.utils classes to .internals, the quota classes to server.quota, LogManager to Java, *ImageTest constants to *ImageFixtures, and the Gradle 9.6 project() change in dependencies {}. The full conflict and fix log is in inkless-sync/sessions/SESSION-2026-11-23.md.

Testing

  • On 583fd40aa8, before the merge commit rename and the fix(inkless:control-plane): guard against stale PostgreSQL standby reads [KC-859] #906 merge, the PR checks passed, including the JUnit jobs on Java 17 and Java 25.
  • Locally on Java 17, against the current tree, the CI check task and the full CI JUnit chain from inkless.yml pass. The CI jOOQ and docs steps leave the tree clean.
  • Before the plugin bump, 29 cluster tests failed with NoClassDefFoundError: org/apache/kafka/common/utils/ByteBufferInputStream from the 1.0.0 remote storage manager. They pass with 1.2.1.

Merging

A repository administrator has to clear Require signed commits and Require linear history in the main ruleset for the merge, then restore them. Some upstream commits have no signature. For the steps, see inkless-sync/MAIN-SYNC-ACTION-PLAN.md, step 10.

🤖 Generated with Claude Code

bbejeck and others added 30 commits July 2, 2026 13:02
Expand coverage for KIP-892 by parameterizing integration tests

Reviewers: TengYao Chi <frankvicky@apache.org>
Extend test to ensure there is an inflight request before completing.
Final validation is about getting no records, so extend to ensure the
case is a request sent an no records returned (and not that there was no
request sent at all, which would lead to no records returned too but
would be a false positive)

Reviewers: TengYao Chi <frankvicky@apache.org>
See the discussion:
apache/kafka#22201 (comment)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
…#22707)

ReplicaManagerLogReader.readAsync fetches data from remote storage, if
enabled. The response is async. Current code does not bound this call to
remote storage. This PR uses the existing `remoteFetchMaxWaitMs` to
alleviate the situation by scheduling a timed killer task into the
replica manager's timer wheel.

A new integ test has been added to ShareConsumerDLQTest to verify e-2-e
tiering  based DLQ.

Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Abhinav Dixit
 <adixit@confluent.io>
Part of KIP-1071.

After an assignment is computed, we need to refine it to apply warmup
tasks. This PR adds the basic control flow into the refiner method; The
actual refiner logic will be added in a follow up PR; for now, we just
return  the unmodified assignment.

The refiner needs access to the whole group assignment, not just the
assignment of a single member. Thus, the PR contains some minor
refactoring for this.

Reviewers: Sean Quah <squah@confluent.io>
…yteStoreAdapter (#22742)

IQv2 range queries throw a `ClassCastException` when the underlying
state store is not RocksDB (e.g. an in-memory store), because
`KeyValueToTimestampedKeyValueByteStoreAdapter` unconditionally cast the
query iterator result to `RocksDbIterator` before wrapping it. With a
transactional store the result is a `StagedMergeIterator`, so the cast
fails.

The adapter exists only to convert plain key/value bytes into the
timestamped format for any key-value store, so coupling its inner
iterator to a specific store implementation is unnecessary. Widening the
field and constructor parameter to `ManagedKeyValueIterator<Bytes,
byte[]>` — the interface every store iterator already implements —
removes the erroneous cast and makes the adapter work regardless of the
underlying store type.

Part of a series of fixes for interactive-query position consistency
with transactional state stores.

Reviewers: Bill Bejeck <bbejeck@apache.org>

Co-authored-by: Bill Bejeck <bbejeck@apache.org>
…ion buffer (#22743)

`InMemoryKeyValueStore`, when transactional, did not correctly track its
`Position` across the transaction boundary, which broke
interactive-query position consistency in two ways.

**Staging.** `put`/`putAll` applied position updates directly to the
store's committed `Position` instead of holding them pending alongside
the staged writes, so the position advanced before the corresponding
data was committed. Position updates are now accumulated in a
`pendingPosition` on `InMemoryTransactionBuffer` during staging and
merged into the committed position only in `commitStagedWrites`.
`discardPendingBatch` (previously a no-op) resets `pendingPosition` so
aborted batches leave no trace. Under READ_UNCOMMITTED, `query` merges
the pending deltas so staged writes remain visible, mirroring
`RocksDBStore`.

**Changelog consistency vector.** `getPosition()` returned only the
committed position. Because `ChangeLoggingKeyValueBytesStore` stamps
each changelog record's consistency vector with `getPosition()` at put
time, a transactional store's changelog records carried a stale (empty)
vector, and the position could not be rebuilt when the store was
restored from its changelog on restart. `getPosition()` now returns the
uncommitted position (committed merged with the buffer's pending
deltas), matching the behaviour `RocksDBStore` already had.

Adds a unit test covering the uncommitted-position behaviour. End-to-end
restart coverage is added separately via the parameterized
`PositionRestartIntegrationTest`.

Part of a series of fixes for interactive-query position consistency
with transactional state stores.

Reviewers: Bill Bejeck <bbejeck@apache.org>
…n buffer (#22744)

`InMemoryWindowStore`, when transactional, did not correctly track its
`Position` across the transaction boundary, breaking interactive-query
position consistency in two ways.

**Staging.** `put` called `StoreQueryUtils.updatePosition` directly on
the store's committed `Position`, making uncommitted records queryable
by position and violating the isolation guarantee. Position updates are
now accumulated in a `pendingPosition` field on
`InMemoryWindowTransactionBuffer` under the existing `snapshotLock`, and
`mergePendingPositionInto` merges them into the committed position at
commit time. `discardPendingBatch` resets the pending position on abort.
Under READ_UNCOMMITTED, `query` merges the pending deltas so staged
writes remain visible, mirroring `RocksDBStore`.

**Changelog consistency vector.** `getPosition()` returned only the
committed position. Because `ChangeLoggingWindowBytesStore` stamps each
changelog record's consistency vector with `getPosition()` at put time,
a transactional store's changelog records carried a stale (empty)
vector, so the position could not be rebuilt when the store was restored
from its changelog. `getPosition()` now returns the uncommitted
position, matching the behaviour `RocksDBStore` already had.

End-to-end restart coverage is added separately via the parameterized
`PositionRestartIntegrationTest`.

Part of a series of fixes for interactive-query position consistency
with transactional state stores.

Reviewers: Bill Bejeck <bbejeck@apache.org>
…on buffer (#22745)

`InMemorySessionStore`, when transactional, did not correctly track its
`Position` across the transaction boundary, breaking interactive-query
position consistency in two ways. The root cause is the same as the
parallel fix for `InMemoryKeyValueStore`.

**Staging.** `put` called `StoreQueryUtils.updatePosition` directly on
the store's committed `Position` on every write, bypassing the
transaction boundary, so IQv2 position-bound queries could observe
position advances corresponding to records not yet visible. Position
updates are now staged into a `pendingPosition` field on
`InMemorySessionTransactionBuffer` under the existing `snapshotLock`,
and merged into the committed position at commit time via
`mergePendingPositionInto`. `discardPendingBatch` resets the pending
position on abort. Under READ_UNCOMMITTED, `query` merges the pending
deltas so staged writes remain visible, mirroring `RocksDBStore`.

**Changelog consistency vector.** `getPosition()` returned only the
committed position. Because `ChangeLoggingSessionBytesStore` stamps each
changelog record's consistency vector with `getPosition()` at put time,
a transactional store's changelog records carried a stale (empty)
vector, so the position could not be rebuilt when the store was restored
from its changelog. `getPosition()` now returns the uncommitted
position, matching the behaviour `RocksDBStore` already had.

End-to-end restart coverage is added separately via the parameterized
`PositionRestartIntegrationTest`.

Part of a series of fixes for interactive-query position consistency
with transactional state stores.

Reviewers: Bill Bejeck <bbejeck@apache.org>

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Under EOS, a transactional `RocksDBStore` persisted its `Position` in a
separate `WriteBatch` flush from the one that persisted the changelog
offsets. A crash between the two flushes could leave the on-disk
position inconsistent with the stored offsets, so on restart the store
could report a position that does not match the data it actually holds.

This change merges the two `commit()` overloads into a single method
that takes both the in-memory `Position` and the changelog offsets. When
offsets are present, the position (merged with any uncommitted deltas)
is written into the *same* staged `WriteBatch` as the offset entries
before `commitStagedWrites()` runs, so the data, offsets, and position
all become durable atomically. The in-memory position is advanced only
after the flush succeeds, so a failure leaves both in-memory and on-disk
state consistent with the previous commit.

Tests that previously passed an empty changelog-offsets map — which now
takes the wipe-offsets path — are updated to pass a sentinel offset so
the position is persisted as intended.

Part of a series of fixes for interactive-query position consistency
with transactional state stores.

Reviewers: Bill Bejeck <bbejeck@apache.org>

Co-authored-by: Bill Bejeck <bbejeck@apache.org>
A StreamsHeartbeatRequest must not contain duplicate task-offset
entries, and should be rejected as invalid request. We also need to
avoid to mutate in-memory state for an invalid request.

Reviewers: David Jacot <david.jacot@gmail.com>
…ions (#22720)

When all partitions in a share session are unassigned with no pending
acknowledgements to be sent, no ShareFetch request was being sent. This
patch sends a ShareFetch to remove the partitions from the share session
in this situation.

Reviewers: Shivsundar R <shr@confluent.io>, Apoorv Mittal
 <apoorvmittal10@gmail.com>
To address


GHSA-j3rv-43j4-c7qm

GHSA-rmj7-2vxq-3g9f

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
…tional mode (#22750)

Extends `PositionRestartIntegrationTest` to run every store type and
configuration with transactional state stores both enabled and disabled.
This exercises interactive-query position consistency and, crucially,
position recovery on restart for transactional stores — the end-to-end
coverage for the series of transactional state-store position fixes
(KAFKA-20760).

Also adds unit tests for `InMemoryWindowStore` and
`InMemorySessionStore`, mirroring the existing `InMemoryKeyValueStore`
test: each verifies that a transactional store exposes its staged
(uncommitted) position via a READ_UNCOMMITTED query and via
`getPosition()` before commit, and its committed position after commit.

Reviewers: Bill Bejeck <bbejeck@apache.org>

Co-authored-by: Bill Bejeck <bbejeck@apache.org>
…led hangs in closing (#22733)

Since `testUnsubscribeDoesNotCommitOffsetsEvenWithAutoCommitEnabled`
enables    auto-commit, closing the consumer in the `@AfterEach`
teardown triggers    `autoCommitOnClose()`, which calls
`commitSyncAllConsumed()` and blocks waiting    on the resulting
`SyncCommitEvent` future:

  ```java
  private void autoCommitOnClose(final Timer timer) {
      if (groupMetadata.get().isEmpty() || applicationEventHandler ==
null)
          return;

      if (autoCommitEnabled)            commitSyncAllConsumed(timer); //
sends a blocking SyncCommitEvent

      applicationEventHandler.add(new CommitOnCloseEvent());
  }
```
  Because the test mocks applicationEventHandler and never completes
this event,
  close() blocks until the timeout.

  This patch completes the commit event during close by calling
completeCommitSyncApplicationEventSuccessfully() at the end of the test

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
…ommandAuthorizationTest (#22591)

Migrate `AuthorizerIntegrationTest` to `ClusterInstance`, and rename to
`ConsumerGroupCommandAuthorizationTest`.

Reviewers: Ken Huang <s7133700@gmail.com>, Mickael Maison
 <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
…hutdown (#22328)

This PR fixes a `ConsumerTask` shutdown race by skipping poll once the
task is closed before partition assignment, preventing the spurious
“consumer not subscribed/assigned” error.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
…2512)

Part of the implementation of

https://cwiki.apache.org/confluence/display/KAFKA/KIP-1242%3A+Detection+and+handling+of+misrouted+connections.

Support coordinator connections and mark ApiVersions v5 API as stable.

Reviewers: TaiJuWu <tjwu1217@gmail.com>, David Jacot
 <david.jacot@gmail.com>, Rajini Sivaram <rajinisivaram@googlemail.com>
Adds support for nested structures to the `ValueToKey` transformer.

[KIP-821: Connect Transforms support for nested
structures](https://cwiki.apache.org/confluence/display/KAFKA/KIP-821%3A+Connect+Transforms+support+for+nested+structures)

Signed-off-by: Hector Geraldino <hgeraldino@gmail.com>
Reviewers: Mickael Maison <mickael.maison@gmail.com>
…ARN (Java client) (#19456)

KAFKA-19117 Issue description:

We experienced an outage in our application due to a built up Kafka lag,
which we eventually discovered to be the problem with Kafka Clients
being throttled.

Even when using the confluent cluster, the dashboard does point to
exceeding the quota of the principal.

It will be nice, if the log message on the client side is a WARNING.
This helps those who don't have visibility to cluster, and just look at
the problem from the client side, setup alerts etc. (instead of enabling
TRACE to figure out where the problem is)

NetworkClient#maybeThrottle in the class NetworkClient:

Changed from:   `log.trace("Connection to node {} is throttled for {} ms
until timestamp {}", nodeId, throttleTimeMs, now + throttleTimeMs); `

 to

 `log.warn("Connection to node {} is throttled for {} ms until timestamp
{}", nodeId, throttleTimeMs, now + throttleTimeMs);`

Reviewers: Kirk True <kirk@kirktrue.pro>, Chia-Ping Tsai
 <chia7712@gmail.com>, PoAn Yang <payang@apache.org>
Reviewers: Ken Huang <s7133700@gmail.com>, Mickael Maison
 <mickael.maison@gmail.com>
Reviewers: Ken Huang <s7133700@gmail.com>, Mickael Maison
<mickael.maison@gmail.com>
Co-authored-by: haiyang.luo <haiyang.luo@ly.com>
…re (#22035)

This PR makes two improvements:
**1. Fail-fast liveness check in `ApplicationEventHandler.add()`:**
Before enqueuing an event,
we now verify the background thread is still alive via
`Thread.isAlive()`. If the thread has
terminated, a `KafkaException` is thrown immediately with an actionable
message directing the
user to check earlier logs for the root cause. This prevents the
application thread from
silently enqueuing events that will never be processed, or blocking
indefinitely on `future.get()`.

**2. Event processing safety net in
`ConsumerNetworkThread.processApplicationEvents()`:** When
an exception happens in  `ApplicationEventProcessor.process()`, the
outer catch block now completes
the event's `CompletableFuture` exceptionally with the actual error.
Previously, the error was
only logged and the future was left dangling — the caller would
eventually receive a generic
`TimeoutException` from the reaper instead of the real cause of the
failure.

Reviewers - @lianetm @kirktrue

Reviewers: Lianet Magrans <lmagrans@confluent.io>
…der.readAsync. (#22753)

The `read` call in `readAsync` was not protected by a try catch block
which could throw an exception in a non-async fashion to the caller.
This PR surrounds the call in try-catch and adds appropriate tests.

Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>
…y-value stores (KIP-1356) (#22666)

This PR is the **first increment of KIP-1356** — the key/value point
query — for  `TimestampedKeyValueStoreWithHeaders`. The
range/window/session header query types described in the  KIP will
follow in subsequent PRs.

## Summary

1. **`TimestampedKeyWithHeadersQuery<K, V>`** (new, `@Evolving`,
`org.apache.kafka.streams.query`) —
   the headers-aware parallel of `TimestampedKeyQuery`, returning a
`ReadOnlyRecord` that carries the
   key, value, timestamp, and headers.
2. **Native header store serves basic IQv2 queries.**
`RocksDBTimestampedStoreWithHeaders` no longer
   overrides `query(...)` to return `UNKNOWN_QUERY_TYPE`; it inherits
`RocksDBStore.query()`, so the
   existing query types (`KeyQuery`, `RangeQuery`, …) behave identically
on both build paths.
3. **Header store caching participates in IQv2 point queries.**
`CachingKeyValueStoreWithHeaders` no
   longer overrides `query(...)` to bypass the cache; it inherits
`CachingKeyValueStore.query()`, so
   point queries consult the record cache (read-your-writes) and honor
`skipCache`.
4. **`skipCache` is honored for the new query.**
`MeteredTimestampedKeyValueStoreWithHeaders` forwards `isSkipCache()`
from `TimestampedKeyWithHeadersQuery` onto the raw `KeyQuery` it builds,
so the caching layer can honor it. (Making `skipCache()` work for the
existing `KeyQuery`/`TimestampedKeyQuery` on the metered stores is a
pre-existing, cross-cutting no-op fix — out of scope here, to be
addressed in a follow-up
[JIRA](https://issues.apache.org/jira/browse/KAFKA-20776).)

The metered header store services `TimestampedKeyWithHeadersQuery` by
forwarding a raw byte-level  `KeyQuery` to the wrapped store and
deserializing the stored `ValueTimestampHeaders` into a `Record`  (a
`ReadOnlyRecord`); an absent or tombstoned key yields a `null` result.

## Testing

- `MeteredTimestampedKeyValueStoreWithHeadersTest` — `skipCache` is
propagated to the forwarded
  `KeyQuery` for `TimestampedKeyWithHeadersQuery`.
- `RocksDBTimestampedStoreWithHeadersTest` — the native store serves
`KeyQuery` (previously `UNKNOWN_QUERY_TYPE`); a genuinely unsupported
query and `RangeQuery` still returns `UNKNOWN_QUERY_TYPE`.
- `TimestampedKeyValueStoreBuilderWithHeadersTest` — IQv2 query handling
parameterized over build path
  (native / adapter / in-memory) × caching on/off, plus a
native-vs-adapter result-parity test.
- `IQv2HeadersStoreIntegrationTest` — end-to-end value/timestamp/headers
round-trip,
  empty-headers, tombstone/absent, `UNKNOWN_QUERY_TYPE` against a
non-headers store, and a
  caching-enabled cache-hit (read-your-writes) case.

Reviewers: Alieh Saeedi <asaeedi@confluent.io>, TengYao Chi
 <frankvicky@apache.org>
Add flaky tag and ref to open jira (has been showing up on PRs)

Reviewers: Andrew Schofield <aschofield@confluent.io>
This patch updates the CreateTopics partition count validation.

Changes:

* Update the validation comment to state that a request may create at
most `MAX_PARTITIONS_PER_BATCH` partitions.
* Use a `long` counter to prevent integer overflow when accumulating
partition counts from the request.
* Move the limit check inside the loop so that oversized requests fail
as soon as the limit is exceeded.

Test:

* Add `testTotalNumberOfPartitionsValidationDoesNotOverflow` to cover a
CreateTopics request large enough to overflow an `int`.

Reviewers: Mickael Maison <mickael.maison@gmail.com>
AuthorizerIntegrationTest runs with a single broker, but the share
coordinator state topic defaults to replication.factor=3, min.isr=2.
This causes unnecessary retries when the test exercises share group
state APIs.

Set share.coordinator.state.topic.replication.factor=1,
share.coordinator.state.topic.min.isr=1 for this test.

Reviewers: Mickael Maison <mickael.maison@gmail.com>
…validation failures (#22712)

Preserve the available plugin versions stored in cached connector plugin
validation failures.

This keeps repeated validation of an unavailable
`connector.plugin.version` consistent with the initial validation
response and avoids an NPE in the cached failure path.

Reviewers: Mickael Maison <mickael.maison@gmail.com>
…a unavailable (#22768)

Improve to avoid unnecessary double rebalance on the classic consumer
when a replica is bounced.

Before this PR, when a replica is bounced it resolves to an empty node
(no host) with a null rack on the consumer metadta view. The consumer's
metadata comparison treated that as a rack change (rack1 to null) and
triggered a rebalance, then a second one when the broker came back (null
to rack1). This affects the classic consumer, every assignor, when
client.rack is configured.

This PR improves the rack comparison to track racks by replica id and
treat an unavailable replica (empty node) as having an unknown rack
rather than a changed one: two metadata snapshots are equivalent if they
expose the same set of racks for available replicas, tolerating a
missing/unknown rack only when the replica it belongs to is unavailable.

Reviewers: David Jacot <david.jacot@gmail.com>
gqmelo added 14 commits December 1, 2026 09:41
- build.gradle: Gradle 9.6 resolves project() inside dependencies {} to a
  ProjectDependency, so read the storage:inkless test output through
  rootProject; storage:inkless uses testFixtures(project(':clients')).
- Follow the move of org.apache.kafka.common.utils classes to
  org.apache.kafka.common.utils.internals.
- Follow the move of the quota classes to org.apache.kafka.server.quota.
- QuotaFactory (now Java): read the consolidation fetch rate limit
  through getLong.
- ReplicaManager: LogManager is now Java, so convert getLog results to
  Scala Options at the inkless call sites.

Assisted-by: Claude Opus 5.5
- Mark AlterDisklessSwitchOptions, AlterDisklessSwitchResult and
  DescribeTopicPartitionsResult with @InterfaceAudience.Public for the
  KIP-1265 public API checker. DescribeTopicPartitionsResult exposes the
  raw protocol response by design, so its members carry
  @SuppressKafkaInternalApiUsage.
- Suppress MethodLength for RemoteLogManager: upstream's remote-storage
  seed call and the inkless reclaim floor push
  cleanupExpiredRemoteLogSegments past 170 lines.
- Reorder imports after the utils.internals move (spotlessApply).

Assisted-by: Claude Opus 5.5
- Pass the new `forwarded` argument to createTopics,
  incrementalAlterConfig(s) and legacyAlterConfigs.
- Build MetadataDelta through MetadataDelta.Builder.
- Use the *ImageFixtures test fixtures instead of the *ImageTest classes.
- Use java.util.Set callbacks in ControllerApis tests and
  org.apache.kafka.network.Request in place of RequestChannel.Request.
- LogManager is now Java: use Optional results and positional
  getOrCreateLog/getLog arguments.
- Replace the deleted kafka.log.LogTestUtils with UnifiedLog.create and
  a local createLogConfig helper.
- Move the inkless describeTopicPartitions tests to
  KafkaAdminClientTopicTest, where upstream moved the topic tests.
- Follow the AbortedTxn, TxnOffsetCommitRequest.Builder and
  ServerTestUtils.clearYammerMetrics moves.
- Use util.Map topic configs in KafkaServerTestHarness.

Assisted-by: Claude Opus 5.5
- ReplicaManagerInklessTest: the Java LogManager has a separate
  getLog(tp) overload, so stub it directly; the Scala default argument
  used to route getLog(tp) through getLog(tp, isFuture). Compare getLog
  results as Scala Options.
- KafkaApisTest: give the diskless topic a topic ID. TxnOffsetCommit now
  resolves topics by ID and rejects topics that resolve to ZERO_UUID.

Assisted-by: Claude Opus 5.5
Kafka 4.4 moved ByteBufferInputStream to
org.apache.kafka.common.utils.internals. Plugin 1.0.0 still references
the old class, so the remote storage manager fails at broker startup
with NoClassDefFoundError. Release 1.2.1 supports Kafka 4.4.

1.2.1 adds runtime dependencies on io.confluent artifacts for Iceberg
support. They aren't on Maven Central and the tests don't use Iceberg,
so exclude them.

Assisted-by: Claude Opus 5.5
… benchmark

Upstream replaced the public MetadataDelta constructor with
MetadataDelta.Builder. `make build` doesn't compile jmh-benchmarks, so
the CI `check` task caught the remaining call site in
InklessMetadataViewTopicFlagBenchmark.

Assisted-by: Claude Opus 5.5
#896 landed on main after the sync branched. Its test calls
getOrCreateLog with Scala named arguments, which the Java LogManager
doesn't support, so pass them positionally.

Assisted-by: Claude Opus 5.5
Upstream 4.4 adds the `:api-checker` included build, and the root
build script loads its plugin. Gradle compiles that plugin with the
running JDK, so its bytecode differs between JDK 25 and JDK 17. The
classpath of generateJooqClasses then changes, and Gradle reruns the
task under JDK 17 in the CI docs step. JDK 17 drops the "this-escape"
warning from the generated @SuppressWarnings annotations, which leaves
the committed jOOQ sources dirty.

The docs targets read the committed jOOQ sources, and CI checks those
sources in a separate JDK 25 step, so `make docs` skips the generation.

Assisted-by: Claude Opus 5.5
#899 and #905 merged into main after the sync branched. Their tests
call incrementalAlterConfig(s) and legacyAlterConfigs without the
`forwarded` argument that upstream 4.4 adds.

Assisted-by: Claude Opus 5.5
Bring in #913, which merged into main after the branch was rebuilt.

Both sides add `.github/dependabot.yml`: upstream 4.4 with a daily
github-actions entry (apache/kafka#21872), and #913 with a weekly Gradle
entry for the `:storage:inkless` dependencies. Keep both entries, and set
the upstream entry's `open-pull-requests-limit` to 0. That stops the
GitHub Actions version-update PRs and keeps the file one line away from
upstream, so later syncs are less likely to conflict on it. Dependabot
security updates aren't limited by this setting.

Assisted-by: Claude Opus 5.5
Bring in #906, which merged into main after the previous main merge.

`ConsolidationFetcherThreadTest` conflicts on an import line: the sync
adds `LogConfig` and `ProducerStateManagerConfig`, and #906 adds
`FileRecordsOrError`. Keep both.

Assisted-by: Claude Opus 5.5
#906 merged into main after the sync branched. Its new
ConsolidationFetcherThreadTest case creates a log with
kafka.log.LogTestUtils, which upstream 4.4 deletes. Move the
UnifiedLog.create call that the sync already inlined in this test into
a createLog helper, and use it in both cases.

Assisted-by: Claude Opus 5.5
Record the renamed upstream merge, the #913 and #906 merges and their
conflict resolutions, the #906 test adaptation, and the verification
on the final tree.

Assisted-by: Claude Opus 5.5
@jeqo
jeqo merged commit 7eda0ed into main Dec 1, 2026
5 checks passed
@jeqo
jeqo deleted the sync/upstream-20261123 branch December 1, 2026 09:57
gqmelo added a commit that referenced this pull request Dec 1, 2026
…ion file

Since the Kafka 4.4 sync (#897), the clients tests load the generated
kafka-version.properties, so getInklessTag() returns the git-describe of
the build instead of "unknown". The upstream CI workflow fails
testInklessTagDefaultsToUnknownAndSuppressesSuffix on main.

Move the suffix logic into inklessTagSuffix(String), as kafkaVersion
already does for the version, and test it with the unknown, empty, and
real tag values.

## Testing

- `./gradlew :clients:test --tests AppInfoParserTest` passes with a real
  inkless tag baked into the build.
- checkstyle, spotless, spotbugs, and the public API checker pass for
  `:clients`.

Assisted-by: Claude Opus 5.5
jeqo pushed a commit that referenced this pull request Dec 1, 2026
…ion file (#922)

Since the Kafka 4.4 sync (#897), the clients tests load the generated
kafka-version.properties, so getInklessTag() returns the git-describe of
the build instead of "unknown". The upstream CI workflow fails
testInklessTagDefaultsToUnknownAndSuppressesSuffix on main.

Move the suffix logic into inklessTagSuffix(String), as kafkaVersion
already does for the version, and test it with the unknown, empty, and
real tag values.

## Testing

- `./gradlew :clients:test --tests AppInfoParserTest` passes with a real
  inkless tag baked into the build.
- checkstyle, spotless, spotbugs, and the public API checker pass for
  `:clients`.

Assisted-by: Claude Opus 5.5
gqmelo added a commit that referenced this pull request Dec 4, 2026
…branch

0.53 is the first release of `inkless-4.4`, so the branch joins the
active table in `RELEASES.md`. The cherry-pick guide now places main at
the 4.4 branch point and records the adaptations of this round: the
SpotBugs exclude on 4.3, and the `forwarded` argument and the
reassignment completion rule on 4.2 and 4.1.

`ca375e2131` reached `main` inside the upstream sync merge #897, so
`branch-consistency.sh` didn't list it, and the 4.1, 4.2, and 4.3
release-prep PRs failed `Compile and Check Java` without it. The guide
now shows how to find Inkless commits inside a sync merge.

The 4.1 session log first listed the hashes of the release-branch
cherry-picks. The session template and the guide's agent prompt now ask
for the hashes of the commits on main, as the other logs list them.

The session logs record the cherry-pick of #882 through #927 to
`inkless-4.1`, `inkless-4.2`, and `inkless-4.3`, and of #911 through
#927 to `inkless-4.4`, with the follow-up pick of `ca375e2131` and the
4.3 jOOQ fix.

Assisted-by: Claude Opus 5.5
jeqo pushed a commit that referenced this pull request Dec 4, 2026
…branch (#939)

0.53 is the first release of `inkless-4.4`, so the branch joins the
active table in `RELEASES.md`. The cherry-pick guide now places main at
the 4.4 branch point and records the adaptations of this round: the
SpotBugs exclude on 4.3, and the `forwarded` argument and the
reassignment completion rule on 4.2 and 4.1.

`ca375e2131` reached `main` inside the upstream sync merge #897, so
`branch-consistency.sh` didn't list it, and the 4.1, 4.2, and 4.3
release-prep PRs failed `Compile and Check Java` without it. The guide
now shows how to find Inkless commits inside a sync merge.

The 4.1 session log first listed the hashes of the release-branch
cherry-picks. The session template and the guide's agent prompt now ask
for the hashes of the commits on main, as the other logs list them.

The session logs record the cherry-pick of #882 through #927 to
`inkless-4.1`, `inkless-4.2`, and `inkless-4.3`, and of #911 through
#927 to `inkless-4.4`, with the follow-up pick of `ca375e2131` and the
4.3 jOOQ fix.

Assisted-by: Claude Opus 5.5
viktorsomogyi pushed a commit that referenced this pull request Dec 4, 2026
…branch (#939)

0.53 is the first release of `inkless-4.4`, so the branch joins the
active table in `RELEASES.md`. The cherry-pick guide now places main at
the 4.4 branch point and records the adaptations of this round: the
SpotBugs exclude on 4.3, and the `forwarded` argument and the
reassignment completion rule on 4.2 and 4.1.

`ca375e2131` reached `main` inside the upstream sync merge #897, so
`branch-consistency.sh` didn't list it, and the 4.1, 4.2, and 4.3
release-prep PRs failed `Compile and Check Java` without it. The guide
now shows how to find Inkless commits inside a sync merge.

The 4.1 session log first listed the hashes of the release-branch
cherry-picks. The session template and the guide's agent prompt now ask
for the hashes of the commits on main, as the other logs list them.

The session logs record the cherry-pick of #882 through #927 to
`inkless-4.1`, `inkless-4.2`, and `inkless-4.3`, and of #911 through
#927 to `inkless-4.4`, with the follow-up pick of `ca375e2131` and the
4.3 jOOQ fix.

Assisted-by: Claude Opus 5.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream This is a PR that brings upstream commits

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0