Skip to content

feat(volume): cli on-demand snapshot checksum for volume#392

Open
davidcheng0922 wants to merge 2 commits intolonghorn:masterfrom
davidcheng0922:issue-11442-on-demand-snapshot-checksum
Open

feat(volume): cli on-demand snapshot checksum for volume#392
davidcheng0922 wants to merge 2 commits intolonghorn:masterfrom
davidcheng0922:issue-11442-on-demand-snapshot-checksum

Conversation

@davidcheng0922
Copy link
Contributor

Which issue(s) this PR fixes:

longhorn/longhorn#11442

What this PR does / why we need it:

  • Support for on-demand snapshot checksum calculation.
  • Update vendor dependency

Special notes for your reviewer:

Usage sample:

./longhornctl-linux-amd64 checksum volume --name=v1 --namespace=longhorn-system

Sample output:

[ec2-user@ip-172-31-2-165 cli]$ ./longhornctl-linux-amd64 checksum volume --name=v1 --namespace=longhorn-system
I0130 06:48:20.027543  257530 shared_informer.go:349] "Waiting for caches to sync" controller="longhorn datastore"
I0130 06:48:20.101704  257530 warnings.go:107] "Warning: v1 Endpoints is deprecated in v1.33+; use discovery.k8s.io/v1 EndpointSlice"
I0130 06:48:20.147017  257530 shared_informer.go:356] "Caches are synced" controller="longhorn datastore"
INFO[2026-01-30T06:48:20Z] Triggering on-demand snapshot checksum calculation  volume=v1
INFO[2026-01-30T06:48:20Z] Snapshot snap-a43073525b7a48f7 has no checksum; scheduling calculation 
INFO[2026-01-30T06:48:20Z] Snapshot snap-54e6c825285644c8 has no checksum; scheduling calculation 
INFO[2026-01-30T06:48:20Z] Requested on-demand checksum calculation for volume v1 
INFO[2026-01-30T06:48:20Z] Calculating snapshot checksums may take some time.You can check progress in the Longhorn UI or with kubectl. 
INFO[2026-01-30T06:48:20Z] Checksum request submitted                    volume=v1
INFO[2026-01-30T06:48:20Z] Cleaning volume on-demand checksum requester  volume=v1
INFO[2026-01-30T06:48:20Z] Completed volume on-demand checksum requester  volume=v1

And user check the snapshot checksum themselves.

Additional documentation or context

Signed-off-by: David Cheng <david.cheng@suse.com>
Longhorn: 11442

Signed-off-by: David Cheng <david.cheng@suse.com>
@davidcheng0922 davidcheng0922 requested a review from a team January 30, 2026 08:56
@davidcheng0922 davidcheng0922 changed the title Issue 11442 on demand snapshot checksum feat(volume): cli on-demand snapshot checksum for volume Jan 30, 2026
@davidcheng0922 davidcheng0922 changed the title feat(volume): cli on-demand snapshot checksum for volume feat(volume): cli on-demand snapshot checksum for volume Jan 30, 2026
@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

❌ Patch coverage is 0% with 93 lines in your changes missing coverage. Please review.
✅ Project coverage is 2.63%. Comparing base (03943a5) to head (1a5b97b).

Files with missing lines Patch % Lines
pkg/remote/volume/hasher.go 0.00% 44 Missing ⚠️
cmd/remote/subcmd/checksum.go 0.00% 42 Missing ⚠️
pkg/utils/kubernetes/client.go 0.00% 6 Missing ⚠️
cmd/remote/longhornctl.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           master    #392      +/-   ##
=========================================
- Coverage    2.70%   2.63%   -0.08%     
=========================================
  Files          39      41       +2     
  Lines        3471    3564      +93     
=========================================
  Hits           94      94              
- Misses       3375    3468      +93     
  Partials        2       2              
Flag Coverage Δ
unittests 2.63% <0.00%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant