Hi, Here is the lifecycle I propose for UDFs and UDTFs registered through CacheConfiguration#setSqlFunctionClasses: 1. When a cache is created, its functions are registered in the cache’s SQL schema. 2. These functions are schema-level objects: queries can use them regardless of which cache initiated the query. However, the cache that registered them owns their registrations. 3. When that cache is destroyed, its function registrations are removed, even if the schema remains. Functions and overloads registered by other caches are unaffected. 4. Recreating the cache registers its functions again. 5. Closing a cache locally or stopping a node does not mean that the functions are removed from the cluster. Nodes starting or rejoining reconstruct the registrations from the existing cache configurations.
For example, suppose caches A and B share schema S, and A registers function S.F. Destroying B should not affect S.F. Destroying A should remove S.F while leaving schema S and B’s tables intact. Queries that subsequently reference S.F would fail to resolve it. This makes the registering cache responsible for the lifetime of its functions. It also means that applications using those functions depend on that cache remaining available.
