refactor(rds): extract engine defaults and final-snapshot helpers#329
Merged
vieiralucas merged 1 commit intomainfrom Apr 13, 2026
Merged
refactor(rds): extract engine defaults and final-snapshot helpers#329vieiralucas merged 1 commit intomainfrom
vieiralucas merged 1 commit intomainfrom
Conversation
create_db_instance and delete_db_instance each had multi-line bodies that didn't need to live inline. - create_db_instance: the port, parameter group, and logical database name defaults were all inline match-on-engine blocks. Move them into default_port_for_engine, default_parameter_group (which handles the 'default.postgres16' / 'default.mysql8.0' / 'default.mariadb10.11' naming), and reuse the existing default_db_name helper. The operation body loses ~35 lines and reads top-to-bottom without stalling on default values. - delete_db_instance: the 80-line 'create final snapshot' block (runtime check, lock-drop read of the source instance, dump_database call, write-locked snapshot insert) becomes its own create_final_db_snapshot method. The conflict check runs twice on purpose — once under the read lock to avoid paying for the dump, once under the write lock to make the commit atomic — and the helper preserves that. No behavior change.
This was referenced Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
`create_db_instance` and `delete_db_instance` each had multi-line bodies that didn't need to live inline.
No behavior change.
Test plan
Summary by cubic
Refactored RDS to extract engine defaults and final snapshot logic into helpers, making
create_db_instanceanddelete_db_instanceshorter and easier to read. No behavior change.default_port_for_engineanddefault_parameter_group; reuseddefault_db_name.create_final_db_snapshot, preserving the double conflict check and lock semantics.Written for commit 76aaa05. Summary will update on new commits.