Repository navigation
fix(catalog): concurrent namespace property updates keep each other's changes - #2283
Conversation
… changes Two clients updating the properties of one namespace at the same time could silently lose one client's change, even when they changed different keys. Each update now locks the namespace row and changes only the keys it names on the stored properties. If two updates set the same key, the later one wins. Every request still returns 200, and `updated`, `removed` and `missing` describe what that request changed.
|
No actionable comments were generated in the recent review. WalkthroughNamespace property updates now accept separate update and removal inputs. The catalog returns the updated namespace and prior properties. The server builds response key lists from those prior properties. PostgreSQL and integration tests cover partial changes and concurrent updates. ChangesNamespace Property Updates
Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant NamespaceAPI
participant CatalogNamespaceOps
participant PostgreSQL
NamespaceAPI->>CatalogNamespaceOps: Send updates and removals
CatalogNamespaceOps->>PostgreSQL: Apply removals, then updates
PostgreSQL-->>CatalogNamespaceOps: Return updated namespace and prior properties
CatalogNamespaceOps-->>NamespaceAPI: Return update outcome
NamespaceAPI->>NamespaceAPI: Build updated, removed, and missing key response
Suggested reviewers: Merge Risk:
|
✅ PR Title Formatted CorrectlyThe title of this PR match the correct format. Thank you! |
Two clients updating the properties of one namespace at the same time could silently lose one client's change, even when they changed different keys.
Each update now changes only the keys it names, on the stored properties, under a lock on the namespace row. If two updates set the same key, the later one wins. Every request still returns 200, and
updated,removedandmissingdescribe what that request changed.Release notes
Bug Fixes
Downstream follow-up
CatalogStore::update_namespace_properties_implandCatalogNamespaceOps::update_namespace_propertiestakeupdates: &HashMap<String, String>andremovals: &[String]instead of the final property map. They return the newUpdatedNamespaceProperties: the namespace after the update and the properties the call replaced.Summary by CodeRabbit