Skip to content

Commit

Permalink
Fix localdb migrations on checkpoint recovery (#5286)
Browse files Browse the repository at this point in the history
## Motivation
The in-code migration 0002 of local DB is not executed on checkpoint recovery. It causes the checkpoint systests fail in #5221.

## Changes
Apply 0002 migration on the checkpoint recovery path.
  • Loading branch information
poszu committed Nov 23, 2023
1 parent 51b425e commit 1906cc3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion checkpoint/recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ func Recover(
return nil, fmt.Errorf("open old database: %w", err)
}
defer db.Close()
localDB, err := localsql.Open("file:" + filepath.Join(cfg.DataDir, cfg.LocalDbFile))
localDB, err := localsql.Open(
"file:"+filepath.Join(cfg.DataDir, cfg.LocalDbFile),
sql.WithMigration(localsql.New0002Migration(cfg.DataDir)),
)
if err != nil {
return nil, fmt.Errorf("open old local database: %w", err)
}
Expand Down

0 comments on commit 1906cc3

Please sign in to comment.