Skip to content

Conversation

@JoaoJandre
Copy link
Contributor

Description

This PR fixes #12524.

After the introduction of the Hidden state, the snapshot chain calculation no longer works as expected for XenServer as it does not consider hidden snapshots as part of the chain, possibly leading to unending chains. This PR fixes this issue by adding the hidden snapshots to the chain calculation.

This PR also fixes a regression introduced in commit d700e2d which made snapshot deletion impossible.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

In an environment using XCP-ng, I set snapshot.delta.max to 3 and followed the steps below:

  1. Create 3 volume snapshots
  2. Delete the oldest volume snapshot
  3. Create a new volume snapshot

Before the changes, the new snapshot would be part of the old chain. With the changes, the last snapshot is a full snapshot that is not part of the old chain.

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 5.88235% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.62%. Comparing base (b869913) to head (1e1e7a9).

Files with missing lines Patch % Lines
...storage/datastore/db/SnapshotDataStoreDaoImpl.java 0.00% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #12597   +/-   ##
=========================================
  Coverage     17.62%   17.62%           
- Complexity    15663    15665    +2     
=========================================
  Files          5915     5915           
  Lines        531171   531186   +15     
  Branches      64938    64938           
=========================================
+ Hits          93601    93608    +7     
- Misses       427031   427037    +6     
- Partials      10539    10541    +2     
Flag Coverage Δ
uitests 3.71% <ø> (ø)
unittests 18.69% <5.88%> (+<0.01%) ⬆️

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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes issue #12524 where the snapshot.delta.max configuration was not being respected on XenServer after the introduction of the Hidden state. The fix ensures that hidden snapshots are properly considered when calculating snapshot chain length, preventing unending snapshot chains. It also resolves a regression in snapshot deletion by using the correct NOTIN operator instead of NEQ when excluding multiple states.

Changes:

  • Modified snapshot chain calculation to include Hidden state snapshots alongside Ready state snapshots
  • Added new DAO method to query snapshots by multiple states using the IN operator
  • Fixed snapshot deletion regression by properly using NOTIN operator for multiple state exclusion

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
DefaultSnapshotStrategy.java Updated getSnapshotImageStoreRef to include Hidden snapshots in chain calculation by using the new multi-state query method
SnapshotDataStoreDaoImpl.java Added search builders for NOTIN and IN operations, implemented new multi-state query method, fixed snapshot deletion query
SnapshotDataStoreDao.java Added interface method signature for querying snapshots by multiple states

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 16711

@JoaoJandre
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@JoaoJandre a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16712

@DaanHoogland
Copy link
Contributor

@blueorangutan test ol9 xcpng83

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol9 mgmt + xcpng83) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-15385)
Environment: xcpng83 (x2), zone: Advanced Networking with Mgmt server ol9
Total time taken: 67313 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12597-t15385-xcpng83.zip
Smoke tests completed. 137 look OK, 12 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_events_resource Error 147.58 test_events_resource.py
test_list_system_vms_metrics_history Failure 0.21 test_metrics_api.py
test_list_vms_metrics_history Failure 185.20 test_metrics_api.py
test_01_non_strict_host_anti_affinity Error 187.25 test_nonstrict_affinity_group.py
test_02_non_strict_host_affinity Error 49.96 test_nonstrict_affinity_group.py
test_01_add_primary_storage_disabled_host Error 15.41 test_primary_storage.py
test_01_primary_storage_iscsi Error 0.16 test_primary_storage.py
test_01_primary_storage_nfs Error 0.16 test_primary_storage.py
ContextSuite context=TestStorageTags>:setup Error 0.26 test_primary_storage.py
test_02_list_snapshots_with_removed_data_store Error 12.59 test_snapshots.py
test_02_list_snapshots_with_removed_data_store Error 12.59 test_snapshots.py
test_01_scale_up_verify Failure 436.03 test_vm_autoscaling.py
test_02_update_vmprofile_and_vmgroup Failure 253.78 test_vm_autoscaling.py
test_06_autoscaling_vmgroup_on_project_network Failure 376.08 test_vm_autoscaling.py
test_06_autoscaling_vmgroup_on_project_network Error 376.08 test_vm_autoscaling.py
test_07_autoscaling_vmgroup_on_vpc_network Failure 383.82 test_vm_autoscaling.py
test_07_autoscaling_vmgroup_on_vpc_network Error 383.84 test_vm_autoscaling.py
ContextSuite context=TestVmAutoScaling>:teardown Error 422.26 test_vm_autoscaling.py
test_01_deploy_vm_on_specific_host Error 0.09 test_vm_deployment_planner.py
test_04_deploy_vm_on_host_override_pod_and_cluster Error 0.13 test_vm_deployment_planner.py
test_08_migrate_vm Error 0.07 test_vm_life_cycle.py
test_11_destroy_vm_and_volumes Error 17.91 test_vm_life_cycle.py
test_12_start_vm_multiple_volumes_allocated Error 56.36 test_vm_life_cycle.py
test_13_destroy_and_expunge_vm Error 4.63 test_vm_life_cycle.py
test_01_migrate_vm_strict_tags_success Error 0.21 test_vm_strict_host_tags.py
test_02_migrate_vm_strict_tags_failure Error 0.20 test_vm_strict_host_tags.py
test_01_restore_vm_strict_tags_success Error 0.18 test_vm_strict_host_tags.py
test_02_restore_vm_strict_tags_failure Error 0.24 test_vm_strict_host_tags.py
test_01_scale_vm_strict_tags_success Error 0.25 test_vm_strict_host_tags.py
test_02_scale_vm_strict_tags_failure Error 0.30 test_vm_strict_host_tags.py
test_01_deploy_vm_on_specific_host_without_strict_tags Error 0.20 test_vm_strict_host_tags.py
test_02_deploy_vm_on_any_host_without_strict_tags Error 2.51 test_vm_strict_host_tags.py
test_03_deploy_vm_on_specific_host_with_strict_tags_success Error 0.25 test_vm_strict_host_tags.py
test_04_deploy_vm_on_any_host_with_strict_tags_success Error 5.78 test_vm_strict_host_tags.py
test_05_deploy_vm_on_specific_host_with_strict_tags_failure Failure 0.21 test_vm_strict_host_tags.py
test_01_verify_ipv6_vpc Error 158.66 test_vpc_ipv6.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Failure 357.76 test_vpc_redundant.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Error 357.79 test_vpc_redundant.py
test_02_redundant_VPC_default_routes Failure 232.72 test_vpc_redundant.py
test_02_redundant_VPC_default_routes Error 232.74 test_vpc_redundant.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Failure 238.72 test_vpc_redundant.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Error 238.74 test_vpc_redundant.py
test_05_rvpc_multi_tiers Failure 236.99 test_vpc_redundant.py
test_05_rvpc_multi_tiers Error 237.01 test_vpc_redundant.py
test_01_redundant_vpc_site2site_vpn Failure 187.57 test_vpc_vpn.py

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

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants