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
Summary
When
transaction_identityis set (inside a transaction), the schema registry resolvesregistrationsto the pending set only. If the pending set is empty (first registration in this transaction), a schema already committed inself._registrationsis NOT checked, so the schema is re-registered viaregister_descriptor, producing a redundant write and potentially a different URI.Evidence
src/jacobian/schema_registry.pyL134-141:Root cause
The cache lookup at L139 only checks the active transaction's pending registrations, not the committed
_registrationscache. Within a transaction, previously committed schemas are invisible.Scope
The lookup should fall through to
self._registrationswhen the pending set does not contain the registration, or maintain a merged view of pending + committed.Source
Generated with Devin