Forcing a Re-Baseline
A re-baseline reloads all rows from the source for a table, replacing the target's current state.
When to re-baseline
- After a suspected data drift
- After a schema change that a target can't handle incrementally
- After restoring a database backup
- After dropping and recreating a replication slot
Trigger via CLI
# Re-baseline a specific table
laredo reload public.config_document
# Re-baseline all tables on a source
laredo reload --source pg_main --all
# Re-baseline everything
laredo reload --all
What happens during re-baseline
- Engine pauses the change stream (stops reading, keeps connection open)
- Engine calls
OnTruncateon all targets for the table (clears existing state) - Opens a new
REPEATABLE READsnapshot transaction - Executes
SELECT *for each table, delivers rows viaOnBaselineRow - Calls
OnBaselineComplete - Resumes the change stream
- Applies any changes that accumulated during the reload
- ACKs the current position once reload and catch-up are complete
Some changes may overlap with rows just loaded during the reload window. Targets must be idempotent for this brief overlap.
Resetting a source
For a full reset (drops and recreates the replication slot):
laredo reset-source pg_main
This is more drastic than a reload — it destroys all position tracking. Use it when the slot is corrupted or you're changing the publication configuration.
To also drop the publication (for decommissioning):
laredo reset-source pg_main --drop-publication