这是indexloc提供的服务,不要输入任何密码
Skip to content

Add support for backup of metadata db to each command which mutates the metadata #512

@kaidaguerre

Description

@kaidaguerre

Simple Metadata Backup

Overview

Each command that mutates the DuckLake metadata file should automatically create a backup before making changes. This provides a safety net for quick recovery from accidental data loss or corruption.

Implementation

Backup Creation:

  • Before any metadata mutation operation, create a timestamped backup
  • Backup filename format: tailpipe_ducklake.db.backup.YYYYMMDDHHMMSS
  • Location: Same directory as the main metadata file (~/.tailpipe/data/<profile>/)

Backup Management:

  • Keep only 1 previous backup (delete older backups)
  • Backup is created before the mutation operation begins
  • If the mutation fails, the backup remains available for restoration

Commands that trigger backup:

  • collect (when creating new tables or inserting data)
  • compact (when reorganizing data)
  • partition delete
  • Any other command that modifies the DuckLake database

Backup Restoration:

  • Manual process: rename backup file to tailpipe_ducklake.db

Expected Outcome

  • Always have a recent backup of metadata before any changes
  • Minimal storage overhead (only 1 backup kept)
  • Transparent to users (automatic backup creation)

Metadata

Metadata

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions