Skip to content

Basic PITR testcase#22

Merged
dutow merged 2 commits into
Percona-Lab:mainfrom
dutow:pitr
Aug 11, 2025
Merged

Basic PITR testcase#22
dutow merged 2 commits into
Percona-Lab:mainfrom
dutow:pitr

Conversation

@dutow

@dutow dutow commented Jul 28, 2025

Copy link
Copy Markdown
Collaborator

This commit adds a simple PITR testcase with the pg_simple test runner that verifies that 1. PITR works 2. data checksums before and after recovery are the same.

Comment thread scenarios/ci/pitr.lua
Comment thread scenarios/ci/pitr.lua Outdated
break
end
sleep(1000)
end

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we need a helper function for tailing logs.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also why don't you tell it to shut down when recovery is done rather than to pause?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could extract it to a helper, but so far this is the only place where we are tailing logs.

As for shutdown: promote would make more sense, it could replace the execute query below, but both are just 1 line in the script.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think extracting it as a local helper in this file would make the code easier to read.

Comment thread scenarios/ci/pitr.lua Outdated
w:discover_existing_schema()
w:calculate_database_checksums(checksumFile)

ret = os.execute("/usr/bin/diff " .. checksumFile .. " " .. backupChecksumFile)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use the full qualified path here but not for cp and mkdir?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also is there a reason it is comapred using diff and not in Lua?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the background process only accepts full paths (execve), and somehow I forgot that I can just write diff here, I'll fix that.

As for why - it seems easier to call diff than to write a lua function to do that.

dutow added 2 commits August 11, 2025 11:28
This commit adds a simple PITR testcase with the pg_simple test runner
that verifies that 1. PITR works 2. data checksums before and after
recovery are the same.
@dutow
dutow merged commit f268724 into Percona-Lab:main Aug 11, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants