-
Notifications
You must be signed in to change notification settings - Fork 273
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
feat(backups): deduplication #6929
base: master
Are you sure you want to change the base?
Conversation
103fe3d
to
8f76708
Compare
@xen-orchestra/fs/src/dedupLocal.js
Outdated
import assert from 'node:assert' | ||
import { createHash } from 'node:crypto' | ||
|
||
export default class DedupedLocalHandler extends LocalHandler { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge with LocalHandler
.
@xen-orchestra/fs/src/dedupLocal.js
Outdated
|
||
async _sync() { | ||
await super._sync() | ||
await this.mkdir(this.#dedupFolder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should only be created when necessary.
@xen-orchestra/fs/src/dedupLocal.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a function to garbage collect orphaned files in the dedup store.
It will be used via xo-fs
CLI and should be documented in a small doc @xen-orchestra/backups/docs/dedup.md
.
@xen-orchestra/fs/src/dedupLocal.js
Outdated
import { createHash } from 'node:crypto' | ||
|
||
export default class DedupedLocalHandler extends LocalHandler { | ||
#dedupFolder = '/xo-block-store' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer directory to folder.
1cb7901
to
a6376bc
Compare
6174c22
to
50f378e
Compare
862d9a6
to
df96930
Compare
@@ -285,7 +293,7 @@ exports.VhdDirectory = class VhdDirectory extends VhdAbstract { | |||
} | |||
|
|||
async writeEntireBlock(block) { | |||
await this._writeChunk(this.#getBlockPath(block.id), block.buffer) | |||
await this._writeChunk(this.#getBlockPath(block.id), block.buffer, this.#dedup) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should use the right flag to ensure we don't overwrite silently, since we'll have to check old block for deletion before
df96930
to
48db60d
Compare
Description
Checklist
Fixes #007
,See xoa-support#42
,See https://...
)Introduced by
CHANGELOG.unreleased.md