{"record":{"id":"7fac66889ec5a676","repo":"rqlite/rqlite","slug":"load-in-progress","errorCode":null,"errorMessage":"load in progress","messagePattern":"load in progress","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"store/store.go","lineNumber":105,"sourceCode":"\tErrWaitForFSMTimeout = errors.New(\"timeout waiting for fsm\")\n\n\t// ErrInvalidBackupFormat is returned when the requested backup format\n\t// is not valid.\n\tErrInvalidBackupFormat = errors.New(\"invalid backup format\")\n\n\t// ErrBackupCASFailed is returned when we cannot acquire the backup CAS lock.\n\tErrBackupCASFailed = errors.New(\"failed to acquire backup CAS lock\")\n\n\t// ErrCDCEnabled is returned when CDC is already enabled.\n\tErrCDCEnabled = errors.New(\"CDC already enabled\")\n\n\t// ErrInvalidVacuum is returned when the requested backup format is not\n\t// compatible with vacuum.\n\tErrInvalidVacuum = errors.New(\"invalid vacuum\")\n\n\t// ErrLoadInProgress is returned when a load is already in progress and the\n\t// requested operation cannot be performed.\n\tErrLoadInProgress = errors.New(\"load in progress\")\n\n\t// ErrNothingNewToSnapshot is returned when a snapshot is requested but there\n\t// are no new log entries to snapshot.\n\tErrNothingNewToSnapshot = errors.New(\"nothing new to snapshot\")\n\n\t// ErrNodeNotFound is returned when a node with a given ID is not found in the cluster.\n\tErrNodeNotFound = errors.New(\"node not found in cluster\")\n\n\t// ErrClusterNotFound is returned when a cluster should exist but does not.\n\tErrClusterNotFound = errors.New(\"cluster not found\")\n\n\t// ErrNoWALToSnapshot is returned when a snapshot is requested but there is no\n\t// WAL data to snapshot. This can happen when the Raft log contains only entries\n\t// that don't modify the database (e.g. cluster membership changes).\n\tErrNoWALToSnapshot = errors.New(\"no WAL data available for snapshot\")\n)\n\nconst (","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/rqlite/rqlite/blob/7586a4d1bdbd9a5a80021664c5a863cd850adb60/store/store.go#L87-L123","documentation":"ErrLoadInProgress is returned when a load (database restore) is already in progress and a snapshot cannot be taken. In Notify/CAS-protected snapshot paths the store inspects the Raft snapshot error and, if it indicates a load is in progress, surfaces ErrLoadInProgress (store.go:2995). Snapshots are unsafe during a restore because the database files are being replaced.","triggerScenarios":"Calling Store.Snapshot (or triggering an auto-snapshot) while a /db/load or /boot restore operation holds the load lock; the underlying raft.Snapshot() error mentioning \"load in progress\" is matched by string and converted to this error.","commonSituations":"Scheduled snapshots or auto-backup firing during a restore window; operator running /db/load while monitoring tooling requests a snapshot; retry logic re-triggering a snapshot mid-load.","solutions":["Delay snapshot/backup operations until the load/restore completes","Serialize operational tasks: pause auto-snapshot schedules during planned restores","Retry the snapshot after the load finishes","Check load/snapshot status via node status endpoints before triggering either operation"],"exampleFix":"// before\n// cron: run snapshot every minute, overlapping with /db/load\n// after\nif err := s.Snapshot(0); err != nil {\n    if errors.Is(err, store.ErrLoadInProgress) {\n        time.Sleep(30 * time.Second); return s.Snapshot(0) // retry after load completes\n    }\n}","handlingStrategy":"validation","validationCode":"// don't snapshot while a load/restore is running\nif loadInProgress.Load() { return errors.New(\"load in progress; defer snapshot\") }","typeGuard":"func isLoadInProgress(err error) bool { return errors.Is(err, store.ErrLoadInProgress) }","tryCatchPattern":"if err := s.Snapshot(trailing); err != nil {\n    if errors.Is(err, store.ErrLoadInProgress) {\n        <-loadDone // wait for restore completion, then retry\n        return s.Snapshot(trailing)\n    }\n    return err\n}","preventionTips":["Pause snapshot/backup schedules during restores","Sequence ops tasks: load first, snapshot after","Share load/snapshot state across automation tooling","Retry snapshots with delay if racing a load"],"tags":["snapshot","load","concurrency"],"backgroundTag":"operation-in-progress","analyzedSha":"7586a4d1bdbd9a5a80021664c5a863cd850adb60","analyzedAt":"2026-09-03T07:03:02.260Z","contentChangedAt":"2026-09-03T07:03:02.260Z","schemaVersion":2},"datasetVersion":"2026-09-10T12:17:11.382Z"}