Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-use existing SQLite database on startup #1799

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
Copy skipped restored on start-up
  • Loading branch information
otoolep committed Jun 10, 2024
commit e66f18cca620176fd9b10f153ee79973864ef429
3 changes: 3 additions & 0 deletions store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 132,7 @@ const (
numLoads = "num_loads"
numRestores = "num_restores"
numRestoresFailed = "num_restores_failed"
numRestoresSkippedOnStart = "num_restores_skipped_on_start"
numAutoRestores = "num_auto_restores"
numAutoRestoresSkipped = "num_auto_restores_skipped"
numAutoRestoresFailed = "num_auto_restores_failed"
Expand Down Expand Up @@ -187,6 188,7 @@ func ResetStats() {
stats.Add(numLoads, 0)
stats.Add(numRestores, 0)
stats.Add(numRestoresFailed, 0)
stats.Add(numRestoresSkippedOnStart, 0)
stats.Add(numRecoveries, 0)
stats.Add(numProviderChecks, 0)
stats.Add(numProviderProvides, 0)
Expand Down Expand Up @@ -513,6 515,7 @@ func (s *Store) Open() (retErr error) {
return fmt.Errorf("failed to create on-disk database: %s", err)
}
if dbReused {
stats.Add(numRestoresSkippedOnStart, 1)
s.logger.Printf("reusing existing database at %s, skipping copy from Snapshot store", s.dbPath)
}
config.NoSnapshotRestoreOnStart = dbReused
Expand Down