Skip to content

fix(import): do not create default user and database in monolith mode - #7801

Merged
mnencia merged 6 commits into
mainfrom
dev/7731
Jul 25, 2025
Merged

mnencia merged 6 commits into
mainfrom
dev/7731

Conversation

@jsilvela

@jsilvela jsilvela commented Jun 10, 2025 •

Copy link
Copy Markdown
Contributor

When importing in monolith mode, avoid automatically creating a default user and database. This approach ensures that the import process accurately mirrors the source environment, preventing the creation of unnecessary or unintended objects. Additionally, the documentation has been updated to clarify the import behavior and usage in monolith scenarios.

Closes #7731
Closes #7447

@jsilvela
jsilvela requested a review from a team June 10, 2025 10:16
@jsilvela
jsilvela marked this pull request as draft June 10, 2025 10:16
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jun 10, 2025
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.22 labels Jun 10, 2025
@github-actions

Copy link
Copy Markdown
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@dosubot dosubot Bot added the bug 🐛 Something isn't working label Jun 10, 2025
@jsilvela

Copy link
Copy Markdown
Contributor Author

/test depth=push test_level=4 feature_type=basic

@github-actions

Copy link
Copy Markdown
Contributor

@jsilvela

Copy link
Copy Markdown
Contributor Author

/test depth=push test_level=4 feature_type=basic

@github-actions

Copy link
Copy Markdown
Contributor

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Jun 10, 2025
@jsilvela

Copy link
Copy Markdown
Contributor Author

/test depth=push test_level=4

@github-actions

Copy link
Copy Markdown
Contributor

@jsilvela
jsilvela marked this pull request as ready for review June 10, 2025 16:56
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jun 10, 2025
@jsilvela jsilvela changed the title fix: for monolith imports, follow source databases fix: for monolith imports, match source databases and owners Jun 10, 2025
@mnencia
mnencia force-pushed the dev/7731 branch 2 times, most recently from a0f9e01 to d2f6312 Compare June 18, 2025 07:55
@mnencia

mnencia commented Jun 18, 2025

Copy link
Copy Markdown
Member

/test d=push tl=4

@github-actions

Copy link
Copy Markdown
Contributor

@jsilvela

Copy link
Copy Markdown
Contributor Author

On your commit d2f631, @mnencia , I thought about that but,
if we have a monolith import and the cluster doesn't declare (database,owner) in the bootstrap,
why should we still apply the defaults for encoding?

@mnencia

mnencia commented Jun 24, 2025

Copy link
Copy Markdown
Member

On your commit d2f631, @mnencia , I thought about that but,
if we have a monolith import and the cluster doesn't declare (database,owner) in the bootstrap,
why should we still apply the defaults for encoding?

Because those are global and affect the catalog encoding

Comment thread docs/src/database_import.md Resolved
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 25, 2025
@mnencia

mnencia commented Jul 25, 2025

Copy link
Copy Markdown
Member

/ok-to-merge

@mnencia mnencia changed the title fix: for monolith imports, match source databases and owners fix(import): do not create default user and database in monolith mode Jul 25, 2025
@mnencia
mnencia merged commit 25db589 into main Jul 25, 2025
@mnencia
mnencia deleted the dev/7731 branch July 25, 2025 09:47
@github-project-automation github-project-automation Bot moved this from Waiting for First Review to Done in CloudNativePG operator development Jul 25, 2025
cnpg-bot pushed a commit that referenced this pull request Jul 25, 2025
…#7801)

When importing in monolith mode, avoid automatically creating a default
user and database. This approach ensures that the import process
accurately mirrors the source environment, preventing the creation of
unnecessary or unintended objects. Additionally, the documentation has
been updated to clarify the import behavior and usage in monolith
scenarios.

Closes #7731
Closes #7447

Signed-off-by: Jaime Silvela <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
Co-authored-by: Gabriele Bartolini <[email protected]>
(cherry picked from commit 25db589)
cnpg-bot pushed a commit that referenced this pull request Jul 25, 2025
…#7801)

When importing in monolith mode, avoid automatically creating a default
user and database. This approach ensures that the import process
accurately mirrors the source environment, preventing the creation of
unnecessary or unintended objects. Additionally, the documentation has
been updated to clarify the import behavior and usage in monolith
scenarios.

Closes #7731
Closes #7447

Signed-off-by: Jaime Silvela <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
Co-authored-by: Gabriele Bartolini <[email protected]>
(cherry picked from commit 25db589)
mnencia added a commit that referenced this pull request Jul 25, 2025
…#7801)

When importing in monolith mode, avoid automatically creating a default
user and database. This approach ensures that the import process
accurately mirrors the source environment, preventing the creation of
unnecessary or unintended objects. Additionally, the documentation has
been updated to clarify the import behavior and usage in monolith
scenarios.

Closes #7731
Closes #7447

Signed-off-by: Jaime Silvela <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
Co-authored-by: Gabriele Bartolini <[email protected]>
(cherry picked from commit 25db589)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-requested ◀️ This pull request should be backported to all supported releases bug 🐛 Something isn't working lgtm This PR has been approved by a maintainer ok to merge 👌 This PR can be merged size:L This PR changes 100-499 lines, ignoring generated files.

Development

Successfully merging this pull request may close these issues.

[Bug]: monolith import may create unintended default database [Bug]: wrong db owner when using monolith import and db name is app

5 participants