[patch] Fix DB2 HADR Setup - #559
Open
tomklapiscak wants to merge 8 commits into
Open
Conversation
tomklapiscak
marked this pull request as draft
August 13, 2026 13:19
db2RemStgManager was segfaulting on 25GB backup files
…is getting forced to "manage"" This reverts commit 626fe54.
tomklapiscak
marked this pull request as ready for review
August 14, 2026 15:25
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.
Description
This PR resolves three separate problems relating to the use of S3 as part of the HADR setup process. These issues were discovered while testing HADR in GovCloud. The first issue is specific to GovCloud, the other two are bugs that I happened to hit, and may be hit in Commercial too.
GovCloud Compatibility
S3 URL is different in GovCloud (e.g.
https://s3-fips.us-gov-east-1.amazonaws.comvshttps://s3.us-east-1.amazonaws.com), which was causing downloads from S3 to fail. This PR fixes this by passing in the value of theSERVERvariable in.PROPSto the--endpoint-urlargument of theaws s3 cpcommand.Issues with large backup files
A subsequent issue was discovered where the
db 2RemStgManagercommand was segfaulting when attempting to upload a large backup file.I had 2 backup parts: 001 is 25GB, and 002 is 97MB.
The
db2RemStgManagercommand code used to upload backup files to S3 is failing for the 25GB 001 part with:but works fine for the 97MB 002 part.
Not sure why it's failing for the large file only:
DB2_OBJECT_STORAGE_LOCAL_STAGING_PATH(>150GB)This PR fixes this by replacing the
db2RemStgManagercommand with a simple call toaws s3 cp(which is already used on the standby to download the backup files).HADR job fails when a backup file is not yet present in COS
If a backup file does not exist in COS at the time the postsync-hadr job runs then
$timestampwill be empty and the following condition will (always) fail:with error:
The condition is incorrect, the
-z ${timestamp}gets evaluated AFTER the first condition, so iftimestampis empty, it will always error.Besides, the logic itself is not correct - the code branch it covers should only be run if there is a backup (and hence a timestamp) and that timestamp is less that 2 days old.
This PR changes the condition to:
with that change in place, the postsync-hadr job that was previously failing now works as expected.
Testing
Verified that HADR setup now works in GovCloud when applied to existing and fresh Manage and Facilities DB2 instances in GovCloud.