Skip to content

KafkaSeekTests offset replay intermittently handles the seek target twice #798

Closed

Description

@thomhurst

KafkaSeekTests.Offset_replay_waits_for_inflight_work_and_canceled_requests_do_not_seek failed intermittently on net10.0 in CI run 43667412124 (PR #797, which only renames the CLI project). It passed on main for 4f2835e just before.

AssertionException: Expected to be 2 but found 1
  at KafkaSeekTests.cs:70  Assert.That(await state.Handled.Reader.ReadAsync(token)).IsEqualTo(expected)

The test holds offset 0 in the handler, requests a seek to offset 1, releases the handler and expects the handled sequence 0, 1, 2. CI saw 0, 1, 1: offset 1 was handled once before the seek took effect and again after it. So a record queued behind the held one can still be dispatched between the in-flight work finishing and PartitionedProcessingControl.SeekAsync applying, which the test comment says the native seek discards.

This started showing after #795 moved to Dekaf 1.28.0 (parallel Kafka receive). The test messages have no key.

Needs a look at Dekaf 1.28.0's partitioned processing seek: whether it guarantees queued records are dropped once in-flight work drains. If it does, this is a Dekaf bug to file there; if not, the test (and the replay docs) need to allow the extra delivery.

Repro: dotnet test -c Release --project tests/Relayer.Kafka.Tests --treenode-filter "/*/*/KafkaSeekTests/Offset_replay_waits_for_inflight_work_and_canceled_requests_do_not_seek" in a loop.

Activity

  1. added
    bug
    area: kafka
    area: testing
    P1
    in-progress
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1area: kafkaarea: testingbugin-progress

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions