Fields that the server sends as null were documented as required, so
generated clients (Dart in particular) failed to parse such responses.
They are now NOT_REQUIRED. Bean validation on save is unchanged.
swagger-core skips @NotNull for a property with
@Schema(requiredMode = NOT_REQUIRED), but still adds the ones with
@NotBlank / @NotEmpty to 'required'; SwaggerConfiguration now removes
them.
entityType carries an EntityType or an AliasEntityType name
(CURRENT_USER, ...), so it is a string; id is required only for an
EntityType, and aliasEntityType is never written. A filter with an alias
did not fit the old schema. AliasEntityType is registered explicitly,
since no schema references it any more. AliasEntityIdTest pins the wire
format.
The document is OpenAPI 3.1, which writes Schema.types, but registerSchema
resolved classes with the OpenAPI 3.0 ModelConverters instance, so
LoginRequest, LoginResponse, ThingsboardErrorResponse and
ThingsboardCredentialsExpiredResponse lost "type": "object". The
/api/auth/token request body had no types either, so refreshToken was
untyped. ColumnSettings declares allOf DataKeySettings explicitly, so it
stays a DataKeySettings subtype however springdoc reaches it first.
The endpoint is available to every authenticated user, but the whole
SystemInfoController was hidden, so generated REST clients had no call
for it and could only read the version from the sysadmin-only
/api/admin/updates. Show the endpoint and return a SystemVersionInfo
record that serializes to the same JSON as the hand-built ObjectNode.
The other two endpoints of the controller stay hidden.
NotificationInfo uses JsonTypeInfo.Id.CLASS without JsonSubTypes, so the
spec had only an empty base schema and generated clients dropped every
subtype field (alarm, rule engine lifecycle, etc.). Add a discriminator
mapping from the fully qualified class name to each of the 24 concrete
subtypes and list them in JsonSubTypes so each one is generated as
allOf NotificationInfo. The wire format is unchanged: Jackson still
writes and reads the class name as the type id.
getAllServiceIds() rebuilds two HashSets just to test membership of a
single id - PartitionService#isKnownServiceId scans the live service
lists directly instead, for the hot path in DefaultTbClusterService's
per-notification unknown-service guard. SetCache.boundedBySize() adds
an LRU-by-size variant alongside the existing TTL-based constructor.
- Extend the unknown-service-id orphan-topic guard to pushNotificationToTransport
- Make HashPartitionService.currentOtherServices volatile (now read on the
per-notification path, written under the synchronized recalculatePartitions)
- Lower the per-skip log from warn to debug to avoid noise when stale service
ids appear in message metadata during normal operation
- Add tests for the transport guard (unknown skipped, known sent)
The tracking compensated for isManagedByCurrentService reporting isolated tenants
of a profile without dedicated servers as not managed (a dedicated server for any
other profile flipped it). That root cause is fixed in #16345, after which a
tenant's managed status changes only together with its own queue ownership, and
its queue keys are already in the partition change event.
Replace the test that pinned the old flip with one that checks the affected
tenants when a dedicated server for the tenant's own profile joins and leaves.
After the managed-status fix the field was only written, never read. It
also held the fallback entries added by resolveByPartitionIdx, so reading
it later as "profiles with dedicated servers" would bring the bug back.
HashPartitionService.resolveByPartitionIdx caches the fallback (regular)
servers of an isolated profile without dedicated servers in
responsibleServices. isManagedByCurrentService then saw a non-empty list
for that profile and reported its tenants as not managed on the regular
servers, although those servers own the tenants' partitions. This happens
as soon as any dedicated server exists in the cluster.
Remember which profiles have dedicated servers before the fallback entries
are added, and use that set in isManagedByCurrentService.
ComponentActor.init calls createProcessor on every init attempt: the
mailbox retries a failed start, and re-initializes an INIT_FAILED actor
(failed start, or failed restart after a configuration update) on the
next RuleNodeUpdatedMsg, reusing the same actor instance. Reusing the
snapshot from actor creation there would keep a stale configuration and
ignore later fixes, so later attempts read the rule node from the
database, as before.
- Resolve affected tenants in PartitionChangeEvent.getAffectedTenants(),
returning null (all tenants) for non rule engine events, empty diffs and
shared queue changes.
- HashPartitionService adds isolated tenants whose managed status changed
without a change of their own queue keys.
- PartitionChangeMsg: forAllTenants/forTenants factories instead of a null
sentinel; affected tenants excluded from toString().
- Fold the AppActor log line into the existing DefaultActorService one.
- Tests: priority ordering in ActorSystemTest, AppActorTest on a real actor
system, DefaultActorServiceTest through onTbApplicationEvent, the
managed-status scenario in HashPartitionServiceTest.
PartitionChangeMsg only carried the affected ServiceType, so a
consumer had no way to know which specific tenants (if any) a given
partition change actually affects versus all of them. Add an optional
affectedTenants set: null preserves today's meaning ("could affect
anyone, notify everyone"), a non-null set means only those tenants are
affected. Existing single-arg construction is unchanged and keeps
defaulting to null.
TbActorSystem/TbActorCtx already supported broadcasting to a filtered
subset of children, and separately broadcasting to all children at a
given priority, but not both together. Expose the existing internal
implementation (already used for the priority-only case) as a public
filtered + prioritized overload, so callers can target a subset of
children without giving up delivery priority.
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).