Skip to content

dekaf: keep connection open on document validation error - #3359

Open
danielnelson wants to merge 2 commits into
masterfrom
dbn/dekaf-schema-leader-not-available
Open

dekaf: keep connection open on document validation error#3359
danielnelson wants to merge 2 commits into
masterfrom
dbn/dekaf-schema-leader-not-available

Conversation

@danielnelson

@danielnelson danielnelson commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Description:

Collection schemas are refreshed every spec_ttl. Currently if a document does not validate against its collection schema the session would log an error and close the connection. This would interrupt all partitions on this connection and the client would need to reconnect. If the error is corrected by the inferred schema you it should be updated on the next spec_ttl refresh, but if the client reconnects before then it would result in further disconnections.

With this change, when a partition fails to validate against the schema, it is placed into "cooldown". LEADER_NOT_AVAILABLE will be reported for this partition. This will indicate to the client that it should retry, but will not affect the ability for other partitions to make progress. The partition remains in cooldown until the collection schema is updated where on the next fetch a new Read is created, or until a timeout (4m default, 2x the spec_ttl) where the connection will be closed with an error like before.

closes: #3338

Workflow steps:

No changes

Documentation links affected:

None

Notes for reviewers:

I've tested this with rdkafka/kcat and tinybird

@danielnelson danielnelson changed the title Dbn/dekaf schema leader not available dekaf: don't close connection immediately on invalid schema Aug 14, 2026
@danielnelson danielnelson changed the title dekaf: don't close connection immediately on invalid schema dekaf: keep connection open on document validation error Aug 14, 2026
@danielnelson
danielnelson force-pushed the dbn/dekaf-schema-leader-not-available branch from 1521000 to 5bffb38 Compare August 14, 2026 16:09
@danielnelson
danielnelson marked this pull request as ready for review August 14, 2026 16:20
@danielnelson
danielnelson requested review from a team August 14, 2026 16:20
Collection schemas are refreshed every spec_ttl.  Currently if a
document does not validate against its collection schema the session
would log an error and close the connection.  This would interrupt all
partitions on this connection and the client would need to reconnect.
If the error is corrected by the inferred schema you it should be
updated on the next spec_ttl refresh, but if the client reconnects
before then it would result in further disconnections.

With this change, when a partition fails to validate against the schema,
it is placed into "cooldown".  LEADER_NOT_AVAILABLE will be reported for
this partition.  This will indicate to the client that it should retry,
but will not affect the ability for other partitions to make progress.
The partition remains in cooldown until the collection schema is updated
where on the next fetch a new Read is created, or until a timeout (4m
default, 2x the spec_ttl) where the connection will be closed with an
error like before.
@danielnelson
danielnelson force-pushed the dbn/dekaf-schema-leader-not-available branch from 5bffb38 to d5d4c74 Compare August 14, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dekaf: incompatible field schema closes session until spec refresh

1 participant