Skip to content

Commit cc0cb34

Browse files
authored
UBERF-9550: Fix backup verification memory usage (#8138)
Signed-off-by: Andrey Sobolev <[email protected]>
1 parent fdd0505 commit cc0cb34

File tree

3 files changed

+191
-123
lines changed

3 files changed

+191
-123
lines changed

dev/tool/src/index.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ export function devTool (
665665
cmd.region,
666666
5000, // 5 gigabytes per blob
667667
sharedPipelineContextVars,
668-
true,
668+
true, // Do full check
669669
async (storage, workspaceStorage) => {
670670
if (cmd.remove) {
671671
await updateArchiveInfo(toolCtx, db, ws.workspace, true)
@@ -781,12 +781,14 @@ export function devTool (
781781
.option('--region [region]', 'Force backup of selected workspace', '')
782782
.option('--full', 'Full recheck', false)
783783
.option('-w|--workspace [workspace]', 'Force backup of selected workspace', '')
784-
.action(async (cmd: { workspace: string, region: string, full: boolean }) => {
784+
.option('-s|--skip [skip]', 'A command separated list of workspaces to skip', '')
785+
.action(async (cmd: { workspace: string, region: string, full: boolean, skip: string }) => {
785786
const { txes } = prepareTools()
787+
const skipped = new Set(cmd.skip.split(',').map((it) => it.trim()))
786788
await withAccountDatabase(async (db) => {
787789
const workspaces = (await listWorkspacesPure(db))
788790
.sort((a, b) => a.lastVisit - b.lastVisit)
789-
.filter((it) => cmd.workspace === '' || cmd.workspace === it.workspace)
791+
.filter((it) => (cmd.workspace === '' || cmd.workspace === it.workspace) && !skipped.has(it.workspace))
790792

791793
let processed = 0
792794

@@ -819,7 +821,11 @@ export function devTool (
819821
processed++
820822
}
821823
} catch (err: any) {
822-
toolCtx.error('Failed to backup workspace', { workspace: ws.workspace })
824+
toolCtx.error('Failed to backup workspace', {
825+
workspace: ws.workspace,
826+
err: err.message,
827+
errStack: err.stack
828+
})
823829
}
824830
}
825831
console.log('Processed workspaces', processed)

0 commit comments

Comments
 (0)