Skip to content

Conversation

@korotkov-aerospike
Copy link
Contributor

@korotkov-aerospike korotkov-aerospike commented Dec 3, 2025

This PR refactors the service layer to pass *model.BackupRoutine objects instead of routine names (string) across the application (Orchestrator, Registry, Backend Service, Retention Manager).

Key Changes:

  • Contextual Data Flow: Services now operate on self-contained BackupRoutine objects, reducing the need for repeated configuration lookups and locking.
  • Model Update: model.BackupRoutine now includes its own Name field.
  • Concurrency Safety: Added a Copy() method to BackupRoutine to provide safe, immutable snapshots of routine configurations to async processes.
  • Registry Decoupling: RunningBackupsRegistry now consumes a narrower routineProvider interface instead of the entire Config object.
  • Fix: Added validation in PopInvalidatedRoutines to ensure deleted routines do not cause nil pointer exceptions.

@codecov-commenter
Copy link

codecov-commenter commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 73.11828% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.57%. Comparing base (11925e0) to head (6364b67).

Files with missing lines Patch % Lines
pkg/service/restore_data.go 0.00% 5 Missing ⚠️
pkg/service/backup_routine_orchestrator.go 80.95% 3 Missing and 1 partial ⚠️
pkg/service/retention_manager.go 60.00% 0 Missing and 4 partials ⚠️
pkg/service/history_manager.go 0.00% 3 Missing ⚠️
pkg/service/retrieve_config.go 0.00% 3 Missing ⚠️
pkg/service/cluster_config_writer.go 0.00% 2 Missing ⚠️
pkg/service/running_backups_registry.go 89.47% 2 Missing ⚠️
pkg/dto/config.go 50.00% 0 Missing and 1 partial ⚠️
pkg/service/backup_namespace_runner.go 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               v3     #468      +/-   ##
==========================================
+ Coverage   50.41%   50.57%   +0.16%     
==========================================
  Files          82       82              
  Lines        5397     5366      -31     
==========================================
- Hits         2721     2714       -7     
+ Misses       2470     2450      -20     
+ Partials      206      202       -4     

☔ 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.

# Conflicts:
#	build/scripts/generate-mocks.sh
#	pkg/service/backup_routine_orchestrator.go
#	pkg/service/backup_routine_orchestrator_test.go
#	pkg/service/mockgen.go
#	pkg/service/running_backups_registry.go
#	pkg/service/running_backups_registry_test.go
@korotkov-aerospike
Copy link
Contributor Author

@korotkov-aerospike korotkov-aerospike marked this pull request as ready for review December 4, 2025 09:29
@reugn reugn changed the title APPS-1836 Every process works on routine copy APPS-1836 Ensure immutable routine configuration in backup and restore Dec 4, 2025
@korotkov-aerospike korotkov-aerospike merged commit b9bd46c into v3 Dec 7, 2025
14 checks passed
@korotkov-aerospike korotkov-aerospike deleted the storage-update branch December 7, 2025 10:43
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.

4 participants