1
0
Fork 0

Merge pull request #1557 from rqlite/remove-wal-req

Remove restriction on non-WAL restore
master
Philip O'Toole 9 months ago committed by GitHub
commit fe4747ba0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -679,13 +679,6 @@ func (s *Service) handleLoad(w http.ResponseWriter, r *http.Request, qp QueryPar
Data: b,
}
if db.IsWALModeEnabled(b) {
s.logger.Printf("SQLite database file is in WAL mode - rejecting load request")
http.Error(w, `SQLite database file is in WAL mode - convert it to DELETE mode via 'PRAGMA journal_mode=DELETE'`,
http.StatusBadRequest)
return
}
err := s.store.Load(lr)
if err != nil && err != store.ErrNotLeader {
http.Error(w, err.Error(), http.StatusInternalServerError)

@ -370,9 +370,6 @@ func (s *Store) SetRestorePath(path string) error {
if !sql.IsValidSQLiteFile(path) {
return fmt.Errorf("file %s is not a valid SQLite file", path)
}
if sql.IsWALModeEnabledSQLiteFile(path) {
return fmt.Errorf("file %s is in WAL mode - convert to DELETE mode", path)
}
s.RegisterReadyChannel(s.restoreDoneCh)
s.restorePath = path

Loading…
Cancel
Save