Skip to content
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

fail restore if WAL wasn't transferred to the DB file #1702

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sivukhin
Copy link
Contributor

@sivukhin sivukhin commented Aug 26, 2024

Context

There is an issue with bottomless as it relies on the fact that last connection will perform checkpoint. This is true if DB is valid, but in case of malformed DB last connection will just exit silently and leave DB empty (4KB DB file and some data in WAL). Current implementation will ignore this situation and just restore empty DB

Changes

  • Add validation that after drop of the last connection there will be no WAL files on the disk. In other case now bottomless will fail to restore because most probably DB were malformed
  • Added simple restore_from_partial_db test which drops several files from S3 and check that DB will be able to start from this partial backup
  • Added simple do_not_restore_from_corrupted_db test which corrupts the DB in S3 and check that sqld is unable to startup from this broken configuration
  • Change bottomless test structure - now we are spawning separate s3 in every test. This will be more tokio/async friendly as tokio test can shutdown runtime and silently kill our shared server

@sivukhin sivukhin force-pushed the bottomless-fail-on-broken-wal branch 2 times, most recently from 6895dc8 to be4f530 Compare August 26, 2024 21:49
@sivukhin sivukhin force-pushed the bottomless-fail-on-broken-wal branch from be4f530 to 18147f0 Compare August 26, 2024 21:49
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.

1 participant