-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(PE-39351) Update add_database plan to work with patching/HAC (#531)
* (PE-39351) Update add_database plan to work with patching/HAC This commit updates the add_database plan to include the pe-patching and pe-hac databases when it cleans up the original postgres on the primary. The add_database plan uses pg_basebackup to copy the entire contents of the postgres DB from the original primary DB to the new DB node's postgres. That process doesn't individually update a list of databases, so there's no context of "which DBs to move", because it just moves everything. However, during the cleanup process on the original DB That exists on the primary, the plan _does_ need to list the individual internal postgres dbs that need to be deleted. * Updating reference.md * Fixing lint --------- Co-authored-by: Neil Anderson <[email protected]>
- Loading branch information
1 parent
1d53909
commit 09d80bb
Showing
3 changed files
with
57 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
function peadm::pe_db_names ( | ||
String $pe_ver, | ||
) >> Array { | ||
$original_db_names = [ | ||
'pe-activity', | ||
'pe-classifier', | ||
'pe-inventory', | ||
'pe-orchestrator', | ||
'pe-rbac', | ||
] | ||
|
||
$pe_2025_or_later = SemVerRange('>= 2025.0.0') | ||
$pe_2023_8_or_later = SemVerRange('>= 2023.8.0') | ||
|
||
case $pe_ver { | ||
# The patching service was added in 2025.0.0 | ||
$pe_2025_or_later: { | ||
$original_db_names + [ | ||
'pe-hac', | ||
'pe-patching', | ||
] | ||
} | ||
|
||
# The host-action-collector (hac) was added in 2023.8 | ||
$pe_2023_8_or_later: { | ||
$original_db_names + ['pe-hac'] | ||
} | ||
|
||
default: { | ||
$original_db_names | ||
} | ||
} | ||
} |
This file contains 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