Skip to content

fix: export backups from a consistent database snapshot - #634

Merged
Sev7eNup merged 1 commit into
mainfrom
fix/608-consistent-backup
Oct 24, 2026
Merged

Sev7eNup merged 1 commit into
mainfrom
fix/608-consistent-backup

Conversation

@Sev7eNup

@Sev7eNup Sev7eNup commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

What & why

Capture all database backup sections and counts in one serializable transaction with execution-strategy retries. Count runtime settings from the captured document.

Add a concurrent-writer regression that restores the generated archive and verifies references and counts.

Fixes #608

The recovery-audit test fixture gives each concurrent context its own connection to a shared in-memory SQLite database, avoiding concurrent use of one connection while preserving every audit assertion.

Testing

Api.Tests: FullyQualifiedName~Backup|FullyQualifiedName~ProvisioningSeederTests|FullyQualifiedName~DatabaseRecoveryAuditServiceTests — 135 passed. A deterministic concurrent-writer regression verifies that exported archives restore with consistent references and counts.

git diff --check passed. Full CI runs on this PR.

public async Task Export_ConcurrentCredentialAndMachineCreation_RestoresIntoEmptyDestination()
{
const string passphrase = "snapshot-backup-passphrase";
var databasePath = Path.Combine(Path.GetTempPath(), $"np-backup-snapshot-{Guid.NewGuid():N}.db");
{
const string passphrase = "snapshot-backup-passphrase";
var databasePath = Path.Combine(Path.GetTempPath(), $"np-backup-snapshot-{Guid.NewGuid():N}.db");
var runtimePath = Path.Combine(Path.GetTempPath(), $"np-backup-snapshot-{Guid.NewGuid():N}.json");
Capture all database backup sections and counts in one serializable transaction with execution-strategy retries. Count runtime settings from the captured document.

Add a concurrent-writer regression that restores the generated archive and verifies references and counts.

Fixes #608
@Sev7eNup
Sev7eNup force-pushed the fix/608-consistent-backup branch from 3bb36ce to 8df3808 Compare October 24, 2026 16:09
@Sev7eNup
Sev7eNup merged commit 453a951 into main Oct 24, 2026
17 checks passed
@Sev7eNup
Sev7eNup deleted the fix/608-consistent-backup branch October 24, 2026 16:23
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.

Concurrent configuration changes produce a successful backup that cannot be restored

2 participants