ExternalDefinitionLookupCache: invalidate on Transport bundle import and on the peer central node (ScadaBridge#65 residual) #83
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up from ScadaBridge#65, closed by
e1734675.That fix drops
ExternalDefinitionLookupCachethrough theAfterConfigurationCommitseam on all 9 ManagementActor handlers that create, update or delete an external system, method or database connection. Two paths still rely only on the cache TTL (DefinitionCacheTtl, 10 s), so they can serve a stale definition for up to 10 s:Do: decide whether 10 s of staleness is acceptable. If it isn't:
Add tests for both.
Partly fixed on main
03de3dcc: new CommonsIExternalDefinitionCacheInvalidator(resolves to the ExternalDefinitionLookupCache singleton); BundleImporter invalidates once after each committed import (never after rollback). Evidence: ExternalSystemGateway 146, Transport.IntegrationTests 137, Transport 198 passed; 2 tests fail without the fix.Remaining (open): peer central node invalidation — needs the decision whether the 10 s TTL bound is acceptable on the peer. Recommendation: accept the 10 s bound and document it unless an operator flow does edit-on-A / use-on-B within seconds; otherwise publish an invalidation over the existing central cluster pub-sub.
Peer half fixed on main
153609ef: ExternalDefinitionLookupCache is now invalidated on the other central node too, via the new centralcentral-cache-invalidationtopic (typed messages, sender-id filter) — management edits and bundle import publish it; the local import half landed earlier (03de3dcc). TTL kept as fallback. Two-node test (TwoNodeClusterFixture, production config + serializer) shows the message crossing and not re-applying on the sender. Evidence (after rebase): slnx 0 warnings/0 errors; ManagementService 752, CLI 571, CentralUI 1533, InboundAPI 373, Security 199, ExternalSystemGateway 146, TemplateEngine 617, Transport.IntegrationTests 145, Host 623, Commons 915 passed; key projects re-run green on the pushed tip.