* perf(repository): add indexes on sp_idx_action_rollout_group_status and sp_idx_action_rollout_status
Rollout monitoring queries (existsByRolloutId, getStatusCountByRolloutId, getStatusCountByRolloutGroupId) filter by rollout or rollout_group on sp_action. The flyway baseline did not index either column, so Postgres
falls back to Seq Scan on every monitoring poll. With 16k action rows this is meaningful — the group-count query takes ~500 ms without the index and ~27 ms with it (Index Only Scan, Heap Fetches: 0).
Bench (16k rows, 1000 iter):
- WHERE tenant=? AND rollout_group=? 18.6x faster on PG
17.6x faster on YugabyteDB
- WHERE tenant=? AND rollout=? GROUP BY status 2.5x faster on PG
1.5x faster on YugabyteDB
Adds V1_20_2 sibling migrations for POSTGRESQL, H2, and MYSQL.
* Fix test assertions that depend on undefined row ordering
Several tests use containsExactly() or index-based comparison on query
results that have no ORDER BY clause. SQL does not guarantee row ordering
without explicit ORDER BY, and databases like YugabyteDB return results
in a different (but valid) order than PostgreSQL/H2.
These tests verify set membership (correct targets assigned, correct
actions stored), not ordering. Changed to order-independent assertions:
- AutoAssignTest: containsExactly -> containsExactlyInAnyOrder
- ControllerManagementTest: index-based loop -> containsExactlyInAnyOrderElementsOf
- TargetFilterQueryManagementTest: containsExactly -> containsExactlyInAnyOrder
Verified passing on H2 (default) and YugabyteDB (PostgreSQL-compatible).
* Trigger ECA re-check
Notes:
1. (!) Eclipselink shall be migrated to 5.0 (in 4.0.8 there are incompatible classes, e.g EJBQueryImpl doesn't implement some newer methods). In the moment is with beta (5.0.0-B12) - JUST for testing!
2. (!) Ethlo plugin doesn't work with Eclipselink 5.0, it builds with Eclipselink 4.0.8 (could be a problem)
3. Dependencies - new starters, test starters changes, some dependencies refactoring
4. Auto-configs split - package changes, some properties classes changes
5. Spring nullable org.springframework.lang.Nullable/NonNull are depecated and replaced with jspcify -> org.jspecify.annotations.Nullable/NonNull (NullMarked)
6. Lombok config - adding lombok.addNullAnnotations=jspecify - to do not mess annotations
7. Distributed lock table changes - SP_LOCK table db migration
8. Spring Retry replaced with Spring Core Retry - does repace retry in hawkbit
9. Specifications -> added Update/Delete(/Predicate) Specifications and JpaSpecificationExecutor changed
10. HawkbitBaseRepositoryFactoryBean modified to register properly
11. Jackson - 2 -> 3, package migrations, finals are not deserialized by default(enable finals deserialization, consider make non-final), too ‘smart’ tries to set complex objects instead of using non args constructor (-> @JsonIgnore), some other default configs made
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
* Modify TargetPollEvent to be per batch update (not per target)
Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
* Get use of remote event's timestame for targetPollEvent
Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
* Revert "Get use of remote event's timestame for targetPollEvent"
This reverts commit 27e3b740e2bb0b02cad1d5a6137db7928901f069.
---------
Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
1. (breaking changes) hawkbit.server.ddi.security.rp.cnHeader and sslIssuerHashHeader are renamed to controllerIdHeader and authorityHeader correspondingly.
2. (breaking changes) their default values are changed: X-Ssl-Client-Cn -> X-Controller-Id and X-Ssl-Issuer-Hash-%d -> X-Authority
3. Now the authority header configuration is not a string forma but just a string. The implemenation checks for this header as comma or ; separated list or seeks for header iteration <authority_header>-%d (iteration starts from 0 or 1
4. Doc fixed
5. As there are breaking changes configuration changes may be needed: a) with changing the hawkbit.server.ddi.security.rp you could turn back the previous default headers (note X-Ssl-Issuer-Hash-%d shall now be X-Ssl-Issuer-Hash), or b) you may change the headers sent by the reverse proxy
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
* Tenant Configuration values varchar to text - support bigger values for configs
access_control_context varchar to text - support bigger values for configs
* Add size constraint in App for Tenant 'conf.value' and rollout/target_filter_query 'access_control_context
* add explicitly not null constraint for clarity
* Add baselines for hawkbit 1.0
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
* Add SQL format, close to the already used
* Organize and unify
* Refactor B1_POSTGRES index names
* Revert ignoreMigrationPattern - will be included in separate PR
---------
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
Co-authored-by: vasilchev <vasil.ilchev@bosch.com>
* Schema changes int->tinyint and foreginkeys/indexes rename
* Optimize schema migration to do all related changes within one statement per table - i.e. no redundant table re-builds
* Foreign key checks disabled for huge dbs
* Merge unify and convergence schemas as they both do migrations on common tables - reduce downtime
* Rename unify schema
* Fix some compile warnings
* Some classes made final
* JPA entities made not serializable
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>