Skip to content

[Bug]: Schema registry ignores committed cache within a transaction #863

Description

@morluto

Summary

When transaction_identity is set (inside a transaction), the schema registry resolves registrations to the pending set only. If the pending set is empty (first registration in this transaction), a schema already committed in self._registrations is NOT checked, so the schema is re-registered via register_descriptor, producing a redundant write and potentially a different URI.

Evidence

src/jacobian/schema_registry.py L134-141:

        if transaction_identity is None:
            registrations = self._registrations
        else:
            pending = self._pending.get(transaction_identity)
            registrations = pending.registrations if pending is not None else {}
        cached_uri = registrations.get(registration)
        if cached_uri is not None:
            return cached_uri

Root cause

The cache lookup at L139 only checks the active transaction's pending registrations, not the committed _registrations cache. Within a transaction, previously committed schemas are invisible.

Scope

The lookup should fall through to self._registrations when the pending set does not contain the registration, or maintain a merged view of pending + committed.

Source

Generated with Devin

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1: highShould be addressed in the current or next iterationarea: kernelCore verification kernel and trust boundariesbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions