fix: add replication slot resources in migration#351
fix: add replication slot resources in migration#351jason-lynch wants to merge 1 commit intomainfrom
Conversation
📝 WalkthroughWalkthroughThe migration logic is extended to persist Changes
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 6 |
TIP This summary will be updated as you push new changes. Give us feedback
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@server/internal/resource/migrations/1_0_0.go`:
- Around line 380-389: The existence checks use Identifier.String() but the
slots map is keyed by Identifier.ID, so replace the .String() calls on
v0_0_0.ReplicationSlotResourceIdentifier(...) and
v1_0_0.ReplicationSlotResourceIdentifier(...) with their .ID values; i.e., look
up slots[...] using the Identifier.ID returned by those constructors instead of
.String() so the map lookups correctly detect existing replication slots and
avoid synthesizing duplicates.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 969af7f1-bbb4-42fa-9308-7243ea574de6
📒 Files selected for processing (8)
server/internal/resource/migrations/1_0_0.goserver/internal/resource/migrations/1_0_0_test.goserver/internal/resource/migrations/golden_test/TestVersion_1_0_0/populate_n3_with_n1_source.jsonserver/internal/resource/migrations/golden_test/TestVersion_1_0_0/single_node_with_replicas.jsonserver/internal/resource/migrations/golden_test/TestVersion_1_0_0/three_nodes.jsonserver/internal/resource/migrations/golden_test/TestVersion_1_0_0/three_nodes_without_slots.jsonserver/internal/resource/migrations/golden_test/TestVersion_1_0_0/with_restore_config.jsonserver/internal/resource/migrations/schemas/v1_0_0/database.go
The replication slot resource wasn't added until v0.7.0, so databases created in versions <= v0.6.2 will be missing this resource. With this change, the migration now adds replication slot resources if they're missing in addition to upgrading any existing resources. PLAT-537
57e93cc to
515f956
Compare
Summary
The replication slot resource wasn't added until v0.7.0, so databases created in versions <= v0.6.2 will be missing this resource. With this change, the migration now adds replication slot resources if they're missing in addition to upgrading any existing resources.
Changes
server/internal/resource/migrations/schemas/v1_0_0/database.goby running:DatabaseIDfield onPostgresDatabaseResourceTesting
Repeat the same test with v0.7.0
PLAT-537