Skip to content

snapshot: ignore stale lock delete failures - #505

Open
ousamabenyounes wants to merge 1 commit into
PlakarKorp:mainfrom
ousamabenyounes:fix/issue-1670-stale-lock-delete
Open

snapshot: ignore stale lock delete failures#505
ousamabenyounes wants to merge 1 commit into
PlakarKorp:mainfrom
ousamabenyounes:fix/issue-1670-stale-lock-delete

Conversation

@ousamabenyounes

Copy link
Copy Markdown

Summary

  • keep snapshot creation going when deleting an already-stale repository lock fails
  • leave stale lock cleanup as an opportunistic step so stores with read/write but no delete permission can still run backups
  • add a regression test using the mock store to deny lock deletion after a stale lock is present

Issue

Fix PlakarKorp/plakar#1670

Test verification (RED -> GREEN)

RED on unmodified origin/main with only the new regression test/helper applied:

--- FAIL: TestCreateIgnoresStaleLockDeleteFailure (0.02s)
    builder_test.go:71:
        Error:       Received unexpected error:
                     mock lock delete denied
FAIL
FAIL    github.com/PlakarKorp/kloset/snapshot    0.036s

GREEN on the patched branch:

ok      github.com/PlakarKorp/kloset/snapshot    0.035s

Full local validation

Baseline origin/main via local run-ci.sh: pass.
Final branch via the same run-ci.sh: pass.

run-ci.sh runs:

go build -v ./...
go test -v -coverprofile=coverage.out -covermode=atomic -timeout 1m ./...
go vet ./...

Diff coverage gate:

diff-coverage-gate: PASS no changed production lines with coverage data

Keep stale lock cleanup opportunistic so repositories without delete permission can still create snapshots when the remaining locks are non-conflicting.
@mathieu-plak

Copy link
Copy Markdown
Contributor

Yeah I'm unsure about that one. That's just one part of the story. Now maintenance is blocked forever from running. The ticket suggests that maintenance should do the cleanup but if you don't have write... you don't have write access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not fail if shared locks can't be removed

2 participants