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

Add section for removing Zero leftovers #35

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

saturnonearth
Copy link

Added a quick workup for a section on how and what to remove from Postgres when trying to get rid of Zero.

Feel free to change the section name if you don't like it (I am not in love with it either).

Please also check all commands as I don't have any experience with psql and did not actually test any of this lol.

See: https://bugs.rocicorp.dev/issue/3262

Copy link

vercel bot commented Dec 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
zero-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 18, 2024 7:07pm

@saturnonearth
Copy link
Author

saturnonearth commented Dec 19, 2024

Note: Add section for publications removal as well:
image

@darkgnotic
Copy link
Contributor

darkgnotic commented Dec 20, 2024

Thank you @saturnonearth !

One thing I think we've missed is replication slots, which are also "cluster"-wide (in pg parlance) and thus also not covered by schemas.

SELECT slot_name FROM pg_replication_slots;

will list the replication slots in the pg cluster. Zero creates slots of the format "zero_{shard-id}". These can be dropped with, e.g.:

SELECT pg_drop_replication_slot('zero_0');

@darkgnotic
Copy link
Contributor

Another database-level artifact is publications.

SELECT pubname FROM pg_publication;

In addition to the default zero_public publication (or whatever the user overrides with --shard-publications, zero creates an internal publication for each shard, of the form _zero_metadata_{shard-id}.

These can be dropped with, e.g.:

DROP PUBLICATION IF EXISTS zero_public;
DROP PUBLICATION IF EXISTS _zero_metadata_0;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants