aiai-bot commented on PR #3953: URL: https://github.com/apache/hertzbeat/pull/3953#issuecomment-3743534142
<!-- code-pr-reviewer --> ## Blocking Issues **Missing @Column annotations causing column name mismatches:** - `AlertDefineMonitorBind.java:51,68` - `alertDefineId` field: Index creation may fail because `@Index` references `alert_define_id` (snake_case) but JPA default naming strategy might generate different column name. Add `@Column(name = "alert_define_id")`. - `CollectorMonitorBind.java:45,62` - `collector` field: Case-sensitive databases (MySQL on Linux, PostgreSQL) may fail if JPA maps to `COLLECTOR` while migration script uses `collector`. Add `@Column(name = "collector")`. - `MonitorBind.java:45,64` - `bizId` field: Same issue as above. Index expects `biz_id` but JPA default might not match. Add `@Column(name = "biz_id")`. **Inconsistent @Column additions with existing schema:** - `Param.java:74,82` & `PluginParam.java:72,82` - Adding `@Column(name = "monitor_id")` and `@Column(name = "field")` assumes snake_case columns exist. If existing databases have camelCase columns from old JPA mapping, migration will fail with "Column not found". Verify actual production column names first. **Missing index for new database initialization:** - `StatusPageIncidentComponentBind.java:44` - `component_id` index was removed from JPA entity. New users initializing via `spring.jpa.hibernate.ddl-auto=create/update` will miss this index (migration scripts won't run), causing performance degradation. Add `@Index(name = "idx_incident_component_component_id", columnList = "component_id")` back. **Migration lock risk:** - `postgresql/V181__update_indexes.sql:30` - `DROP INDEX` in transaction requires `ACCESS EXCLUSIVE` lock. Under concurrent query load, this may cause indefinite wait blocking application startup. Consider `CONCURRENTLY` option or document low-peak execution requirement. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
