rqlite/rqlite · error

executing reap plan: %w

Error message

executing reap plan: %w

What it means

executeReapPlan ran the persisted plan via plan.Plan.Execute and the executor returned an error mid-plan (wrapped via %w). Because plan operations run in order and stop at the first error, the store may be mid-reap; the plan file remains on disk so the next startup/check resumes it.

Source

Thrown at snapshot/store.go:664

		p.AddRename(full.path, finalDir)
	}

	// Persist the plan to disk for crash recovery.
	if err := plan.WriteToFile(p, s.reapPlanPath); err != nil {
		return 0, 0, fmt.Errorf("writing reap plan: %w", err)
	}

	return s.executeReapPlan(p, s.reapPlanPath)
}

// executeReapPlan executes a reap plan and cleans up.
func (s *Store) executeReapPlan(p *plan.Plan, planPath string) (int, int, error) {
	startT := time.Now()
	defer recordDuration(reapExecuteDuration, startT)

	executor := plan.NewExecutor()
	if err := p.Execute(executor); err != nil {
		return 0, 0, fmt.Errorf("executing reap plan: %w", err)
	}

	if err := fsutil.SyncDirMaybe(s.dir); err != nil {
		return 0, 0, fmt.Errorf("syncing store dir: %w", err)
	}

	// Clean up the plan file.
	os.Remove(planPath)
	return p.NReaped, p.NCheckpointed, nil
}

// signalReap sends a non-blocking signal to the reaper goroutine.
func (s *Store) signalReap() {
	select {
	case s.reapCh <- struct{}{}:
	default:
	}
}

View on GitHub (pinned to 7586a4d1bd)

Solutions

  1. Inspect the wrapped error to see which plan operation failed (remove/rename/verify)
  2. Resolve the filesystem issue (permissions, missing files, disk full)
  3. Restart or re-check the store; the interrupted plan is resumed automatically
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at snapshot/store.go:664 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of rqlite/rqlite@7586a4d1bd (2026-09-03). Data as JSON: /api/errors/0226101bdd0c19ce. Report an issue: GitHub.