conductor-oss / conductor-oss/conductor
Flyway V9 checksum mismatch on upgrade due to modified V9__indexing_index_fix.sql
- Dominant language
- Java
- Stars
- 32.2k
- Forks
- 1k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 41
Description
## Problem
When upgrading between Conductor versions, `V9__indexing_index_fix.sql` was modified after its initial release: the index `task_index_json_data_json_idx` was renamed to `task_index_json_data_fulltext_idx` (commit `26af4cb`). This changed the file's checksum, causing a Flyway mismatch that prevents startup for any instance that had already applied the original V9:
```
Migration checksum mismatch for migration version 9
-> Applied to database : 1904511200
-> Resolved locally : -975282508
```
Additionally, the Flyway instance in `PostgresConfiguration` is created manually via `Flyway.configure()`, bypassing Spring Boot's `FlywayAutoConfiguration`. This means standard `spring.flyway.*` properties (such as `repair-on-migrate`) have no effect, leaving no easy way to resolve the mismatch without manually updating the `flyway_schema_history` table.
## Workaround
PR #855 adds two configurable properties under `conductor.postgres.*`:
- **`flywayRepairOnMigrate`** (default: `false`) — automatically repairs the schema history on checksum mismatches.
- **`flywayValidateOnMigrate`** (default: `true`) — controls whether Flyway validates migration checksums before running.
Users upgrading from older versions can set:
```properties
conductor.postgres.flyway-repair-on-migrate=true
```
### Notes
- `repair()` runs on **every startup** when the flag is enabled, not just during an upgrade. It is idempotent, but users should disable it after the upgrade is complete.
- `flywayValidateOnMigrate=false` bypasses Flyway's checksum safety entirely and should be treated as a **last resort**, not a routine setting.
Contributor guide
Assessment
This issue has not been assessed yet.