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

Improve replication object clean-up on failure. #59

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kathia-barahona
Copy link
Contributor

@kathia-barahona kathia-barahona commented Jan 20, 2025

Added some improvements on error handling whenever pg_migrate is cleaning any replication object (publication, subscription, replication slot). As our current implementation does not drop objects whenever create_<repl_object_type> fails (raises an exception). Current clean-up is dependent on the object name returned by those functions, but if nothing is returned then nothing will be cleaned. The improvement makes the cleanup independent from the return of such functions, as it nows fetches the replication object name and verifies it exists or not, instead of relying on return values.

Also updated git workflow, for testing against newer versions (PG13-PG17) and use >= Python 3.10

Proposed changes in this pull request

Type (put an x where ever applicable)

  • Bug fix: Link to the issue
  • Feature (Non-breaking change)
  • Feature (Breaking change)
  • Documentation Improvement
  • Other

Checklist

Please put an x against the checkboxes. Write a small comment explaining if its N/A (not applicable)

  • All the tests are passing after the introduction of new changes.
  • Added tests respective to the part of code I have written.
  • Added proper documentation where ever applicable (in code and README.md).

Optional extra information

@kathia-barahona kathia-barahona force-pushed the kathiabarahona/improve_exception_handling_on_cleanup branch 22 times, most recently from 427112f to 5f25dcc Compare January 23, 2025 12:55
Added some improvements on error handling whenever pg_migrate is cleaning any replication object (publication, subscription, replication slot). As our current implementation does not drop objects whenever create_<repl_object_type> fails (raises an exception). Current clean-up is dependent on the object name returned by those functions, but if nothing is returned then nothing will be cleaned. The improvement makes the cleanup independent from the return of such functions, as it nows fetches the replication object name and verifies it exists or not, instead of relying on return values.
@kathia-barahona kathia-barahona force-pushed the kathiabarahona/improve_exception_handling_on_cleanup branch from 5f25dcc to b5e7be4 Compare January 24, 2025 09:33
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.

1 participant