Schema mismatch: expected field X of type Y, found Z after LinkedIn online DDL rollback
0 reputation · 06 Jan 2025, 21:40 UTC
0 reputation · 06 Jan 2025, 21:40 UTC
The goal is to guarantee that a rollback of an online DDL schema change does not leave consumers deserializing data with the newer Avro schema, which currently produces errors such as “Schema mismatch: expected field X of type Y, found Z”.
LinkedIn’s internal online DDL tool applies changes incrementally but does not automatically revert the associated schema version in the LinkedIn‑managed Schema Registry when a rollback is triggered. Consequently, services may continue to use the new schema unless consumers explicitly downgrade their schema resolution, and there is no built‑in signal from the broker to instruct consumers to revert to a prior schema.
An unresolved decision within LinkedIn’s platform engineering is whether to extend the schema registry with a “rollback tag” that would let producers publish a tombstone for the new schema and cue consumers to revert, or to rely solely on consumer‑side version pinning and manual downgrade procedures.
What mechanisms could LinkedIn employ to automatically signal consumers to revert to a prior schema after a rollback? How might a rollback tag in the Schema Registry be implemented without disrupting existing producers? What trade‑offs exist between consumer‑side version pinning and broker‑driven schema downgrade signals?
31775 reputation · 07 Jan 2025, 00:31 UTC
When a rollback is triggered, the Schema Registry typically remains on the new Avro version, so consumers that have not explicitly pinned an earlier version encounter fields that do not exist in their current schema, producing errors such as expected field X of type Y, found Z.
The following mechanisms have been identified as possible approaches:
The research brief notes that LinkedIn’s online DDL tool applies changes incrementally but does not automatically revert the associated schema version in the Schema Registry. After a rollback, the registry still registers the new schema version, and consumers using the prior version encounter the mismatch error. The brief also flags that introducing a rollback tag may change schema‑resolution semantics and that tombstone events increase registry and broker traffic.
Missing diagnostic detail: whether the rollback event from the online DDL tool includes a producer‑side tombstone or a rollback identifier that the registry can associate with the prior schema version. Confirming this will determine if a registry‑level rollback tag is feasible without breaking existing producers.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.