Skip to content

Commit bcf0483

Browse files
authored
Merge pull request #173 from tanmoysrt/integrate_filewarmer
feat: Use Filewarmer instead of dd
2 parents 9a922e2 + 03549d4 commit bcf0483

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

agent/database_physical_restore.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ def __init__(
5959

6060
@job("Physical Restore Database")
6161
def create_restore_job(self):
62+
from filewarmer import FWUP
63+
64+
self.fwup = FWUP()
6265
self.validate_backup_files()
6366
self.validate_connection_to_target_db()
6467
self.warmup_myisam_files()
@@ -335,8 +338,8 @@ def _warmup_files(self, file_paths: list[str]):
335338
336339
Ref - https://docs.aws.amazon.com/ebs/latest/userguide/ebs-initialize.html
337340
"""
338-
for file in file_paths:
339-
subprocess.run(["dd", "if=" + file, "of=/dev/null", "bs=1M"], check=True)
341+
342+
self.fwup.warmup(file_paths, method="io_uring")
340343

341344
def _perform_file_operations(self, engine: str):
342345
for file in os.listdir(self.backup_db_directory):

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ boto3==1.18.0
22
certifi==2019.11.28
33
chardet==3.0.4
44
click==8.1.3
5+
filewarmer==0.0.13
56
Flask==1.1.1
67
grequests==0.6.0
78
gunicorn==20.0.4

0 commit comments

Comments
 (0)