getRuleNodeRelations keeps reading relations through the relation cache, but
validates their targets with the same batched check as getRuleNodesRelations,
so the rule engine and the metadata API cannot diverge on which connections
are valid.
A rule chain without nodes (just created, or with all nodes removed) passed an
empty id list to getRuleNodesRelations, which validateIds rejects, so the rule
chain actor failed to start or update.
Use id = ANY(:ids) / from_id = ANY(:fromIds) instead of IN lists, so the
statement text is the same for every batch size and prepared plans are
reused. Add a test with a rule chain larger than one batch and several
1 MB rule node configurations; it also runs on Citus.
Rule chain initialization issued roughly 3N + E sequential queries per
chain (N nodes, E node connections): one findById per node in
getRuleChainNodes, a second findRuleNodeById per node in the rule node
actor, one relation lookup per node for routes and one existence
check per route target. Each by-id read runs in its own read-only
transaction, so start-up is bound by round trips and JDBC connection
hand-offs, and it saturates the connection pool shared with message
processing on large multi-tenant deployments.
- getRuleChainNodes reads the chain's nodes with batched id IN queries
- new RuleChainService.getRuleNodesRelations loads the outgoing
relations of all chain nodes and validates rule node targets in
batches (RelationDao.findAllByFromIds); dangling relations are still
removed, as in getRuleNodeRelations
- initRoutes uses the batched relations
- the rule chain actor hands each loaded RuleNode to its rule node
actor, which copies it (deep-copied configuration, plus the fields the
RuleNode copy constructor skips) instead of re-reading it
Both batched reads are served by existing indexes (rule_node_pkey,
idx_relation_from_id).
Calculated field actors page through each tenant's calculated fields on
startup (WHERE tenant_id = ? ORDER BY id LIMIT ?). With no index leading on
tenant_id, every page and its count query scan the whole table and sort,
so startup cost grows with tenants x table size.
Ship the index in schema-entities-idx.sql for new installs and as a new
4.4.1.0 LTS migration for existing ones (4.4.0.0 is already released, and
the range lower bound is exclusive).
Offline upgrades now accept any version of a supported LTS family (4.3.x)
instead of fixed 4.3.0/4.3.1 prefixes, and refuse an older version of the
package's own family with a pointer to the no-downtime update applied on
startup, so third-digit releases such as 4.4.1 need no upgrade script.
The CE minimum for the CE-to-PE upgrade is 4.3.1.6, the first CE release
that ships the community grant.
LtsVersion, LtsMigration and LtsMigrationService are renamed to Version,
Migration and MigrationService, and the empty upgrade/basic/schema_update.sql
placeholder is removed along with its load.