-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pghoard: ignore delta backup failures counter in some cases #621
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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 |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
|
||
import pghoard.pghoard as pghoard_module | ||
from pghoard.common import ( | ||
TAR_METADATA_FILENAME, BaseBackupFormat, FileType, create_alert_file, delete_alert_file, write_json_file | ||
TAR_METADATA_FILENAME, BackupReason, BaseBackupFormat, FileType, create_alert_file, delete_alert_file, write_json_file | ||
) | ||
from pghoard.pghoard import PGHoard | ||
from pghoard.pgutil import create_connection_string | ||
|
@@ -92,7 +92,7 @@ def test_get_local_basebackups_info(self): | |
assert available_backup["name"] == "2015-07-03_0" | ||
start_time = datetime.datetime(2015, 7, 3, 12, tzinfo=datetime.timezone.utc) | ||
assert available_backup["metadata"]["start-time"] == start_time | ||
assert available_backup["metadata"]["backup-reason"] == "scheduled" | ||
assert available_backup["metadata"]["backup-reason"] == BackupReason.scheduled | ||
assert available_backup["metadata"]["normalized-backup-time"] is None | ||
assert available_backup["metadata"]["backup-decision-time"] | ||
|
||
|
@@ -900,6 +900,7 @@ def test_surviving_pg_receivewal_hickup(self, db, pghoard): | |
os.makedirs(wal_directory, exist_ok=True) | ||
|
||
pghoard.receivexlog_listener(pghoard.test_site, db.user, wal_directory) | ||
time.sleep(0.5) # waiting for thread setup | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are those sleeps really necessary? |
||
conn = db.connect() | ||
conn.autocommit = True | ||
|
||
|
@@ -918,6 +919,7 @@ def test_surviving_pg_receivewal_hickup(self, db, pghoard): | |
# stopping the thread is not enough, it's possible that killed receiver will leave incomplete partial files | ||
# around, pghoard is capable of cleaning those up but needs to be restarted, for the test it should be OK | ||
# just to call startup_walk_for_missed_files, so it takes care of cleaning up | ||
time.sleep(0.5) # waiting for the end of file processing | ||
pghoard.startup_walk_for_missed_files() | ||
|
||
n_xlogs = pghoard.transfer_agent_state[pghoard.test_site]["upload"]["xlog"]["xlogs_since_basebackup"] | ||
|
@@ -930,6 +932,7 @@ def test_surviving_pg_receivewal_hickup(self, db, pghoard): | |
# restart | ||
pghoard.receivexlog_listener(pghoard.test_site, db.user, wal_directory) | ||
assert pghoard.receivexlogs[pghoard.test_site].is_alive() | ||
time.sleep(0.5) # waiting for thread setup | ||
|
||
# We should now process all created segments, not only the ones which were created after pg_receivewal was restarted | ||
wait_for_xlog(pghoard, n_xlogs + 10) | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to discuss whether we need to consider backoff retry internal for this two new cases. Just keeping retrying without waiting a bit seems less meaningful to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not do any backoff in case if the backup was requested manually, it's up to the user to decide if backup needs to be tried.
As for the second case, I am not quite sure it makes sense because if the backup used to fail and maxed out and is now failing, probably the problem did not go away. Thus I would not waste resources and money on object storage calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. Only let "requested" backup keep retrying.