"Kopia maintenance --full" not clearing space

Hi,

I was playing around with Kopia prior to committing, and I’m not able to get the pruning functionality to work correctly. This is with Kopia 0.6.4 on Windows 10 WSL2.

Create directories and initial snapshot

cd ~
mkdir testing_kopia && cd testing_kopia
kopia repository create filesystem --path "$HOME/testing_kopia/kopia_backups"
mkdir backup_dir
base64 /dev/urandom | head -c 2M > backup_dir/file.txt # Create 2MB file
base64 /dev/urandom | head -c 2M > backup_dir/file2.txt # Create 2MB file
base64 /dev/urandom | head -c 10M > backup_dir/file3.txt # Create 10MB file
kopia snapshot create backup_dir

Check storage used by kopia and backup_dir:

~/testing_kopia$ du -hs backup_dir kopia_backups
15M     backup_dir
15M     kopia_backups

Deleting 10MB file and old snapshot

rm backup_dir/file3.txt
kopia snapshot create backup_dir

~/testing_kopia$ kopia snapshot ls
amir@pc:/home/amir/testing_kopia/backup_dir
  2020-09-14 22:39:32 AEST k04c7f50d8c15a9d81c83a7f847ed5b67 14.7 MB drwxr-xr-x files:3 dirs:1 (latest-2)
  2020-09-14 22:43:15 AEST k84c2fb6ed28dc6079b68dfa2c1dd9dfb 4.2 MB drwxr-xr-x files:2 dirs:1 (latest-1,annual-1,monthly-1,weekly-1,daily-1,hourly-1)
  
kopia snapshot delete k04c7f50d8c15a9d81c83a7f847ed5b67 --delete # Delete older snapshot

Running maintenance 1 day later

~/testing_kopia$ kopia maintenance --full
17:30:51.224 [maintenance] Running full maintenance...
17:30:51.224 [snapshotgc] looking for active contents
17:30:51.224 [snapshotfs] processed(0/1) active 1
17:30:51.225 [snapshotgc] looking for unreferenced contents
17:30:51.225 [maintenance] Found safe time to drop indexes: 2020-09-15 08:39:18.695644 +1000 AEST
17:30:51.225 [maintenance] Dropping contents deleted before 2020-09-15 08:39:18.695644 +1000 AEST
17:30:51.228 [maintenance] Rewriting contents from short packs...
17:30:51.231 [maintenance] Finished full maintenance.

Yet the storage usage of “kopia_backups” hasn’t decreased.

~/testing_kopia$ du -hs backup_dir kopia_backups
4.1M    backup_dir
15M     kopia_backups

Am i doing something wrong?

1 Like

You’re doing it right.

It should all be working in 0.7.0-rc1.

It’s not going to work in 0.6.x branch as we’ve decided to disable blob cleanup in 0.6.3 as we investigated potential data corruption issue. See for more context https://github.com/kopia/kopia/pull/552

Also be aware that maintenance requires the passage of time for safety reasons, in case there were parallel kopia sessions also modifying the repository (kopia does not use locks) so it will not immediately delete all blobs that are eligible for deletion, but will do so in the long run.

Thanks for the info, I got the 0.7.0-rc1 version and retried, but it hasn’t deleted it yet.

I’ll try again in a few days :slight_smile: