faster incremental backups when multiple stacks share one repository

This commit is contained in:
Jarek Krochmalski committed 2026-09-02 15:52:44 +02:00
1 parent 002f53ce78
commit 46a137316f
2 files changed
+17 -2

No files matched your search

+11 -1
View File
@@ -12,10 +12,20 @@ describe('buildBackupArgs', () => {
it('builds the core backup argv over /volumes and /metadata', () => {
const a = buildBackupArgs(base);
expect(a.slice(0, 6)).toEqual(['backup', '--json', '--retry-lock', '5m', '--host', 'dockhand.local']);
expect(a.slice(0, 4)).toEqual(['backup', '--json', '--retry-lock', '5m']);
const hostIdx = a.indexOf('--host');
expect(a[hostIdx + 1]).toBe('dockhand.local');
expect(a).toContain('/volumes/');
expect(a).toContain('/metadata/');
});
it('groups parent selection by the dockhand tags so a stack parents its own snapshot (#1494)', () => {
// Without this, every stack shares host+paths (/volumes/, /metadata/), so restic picks
// the newest snapshot of ANY stack as the parent and re-hashes the whole source.
const a = buildBackupArgs(base);
const i = a.indexOf('--group-by');
expect(i).toBeGreaterThanOrEqual(0);
expect(a[i + 1]).toBe('host,paths,tags');
});
it('backs up ONLY /metadata when the target has no volumes (config-only snapshot)', () => {
const a = buildBackupArgs({ ...base, hasVolumes: false });
expect(a).toContain('/metadata/');