Skip to content

Conversation

@caffeinated92
Copy link
Collaborator

This pull request refactors the cluster backup and restic management code to replace the old archiver-based implementation with a new, modular backupmgr-based approach. The changes unify and modernize how restic backup tasks are managed, improve error handling, and introduce new queue management functions for restic operations.

Key changes include:

Migration from archiver to backupmgr for Restic Management

  • Replaced all references to archiver with the new backupmgr package throughout the cluster codebase, including types, imports, and function calls. This affects initialization, task management, and configuration of restic backups. [1] [2] [3] [4] [5] [6] [7] [8] [9]

  • Updated struct members in Cluster to use ResticManager instead of ResticRepo, and BackupMetaMap from backupmgr instead of config. [1] [2]

Restic Task Queue Management Enhancements

  • Added new methods to manage the restic task queue, including adding, moving, canceling, clearing, running, and pausing tasks (ResticModifyQueue, ResticCancelTask, ResticClearQueue, ResticRunQueue, ResticPauseQueue).

  • Changed queue management functions to operate on the new ResticManager and its TaskQueue.

Improved Error Handling and Monitoring

  • Refactored error handling for restic operations, introducing CheckResticErrors and improving how errors are fetched, cleared, and reported as cluster states.

  • Enhanced handling of configuration backup and restore, and improved backup config error reporting. [1] [2]

API and ACL Adjustments

  • Updated API access control logic to reflect new restic endpoint paths (/restic/snapshots, /restic/stats) instead of old /archives endpoints.

Miscellaneous Refactoring

  • Updated backup post-script logic and types to use backupmgr.BackupMethod instead of config.BackupMethod. [1] [2]
  • Changed a function call in schema monitoring to use dbhelper instead of config for table mapping.

These changes modernize the backup management infrastructure, improve maintainability, and lay the groundwork for future enhancements.

…rences throughout the codebase for improved clarity and functionality (#1279)
- Updated the PointInTimeMeta structure to use backupmgr package in api_database.go.
- Cleaned up whitespace in SetActionForClusterSettings and GetBackups methods in repmanv3.go.
- Deleted the archiver module as it is no longer needed.
- Introduced a new backupmgr package with comprehensive backup management functionalities, including BackupMetadata, PointInTimeMeta, and various backup strategies.
- Implemented ResticManager for handling backup tasks, including fetching, purging, and managing repository keys.
- Enhanced error handling and logging throughout the backup process.
- Updated endpoint paths from /archives to /restic for consistency.
- Renamed handler functions to reflect the new endpoint structure.
- Adjusted documentation comments to match the new endpoint paths and functionality.
- Ensured that all related handlers for backups and stats are correctly mapped to the new Restic terminology.
- Added new API endpoint to cancel Restic tasks in `api_cluster.go`.
- Introduced `handlerMuxCancelResticTask` to handle cancellation requests.
- Updated `cluster_grpc.pb.go` to use `dbhelper.Table` for schema handling.
- Refactored React components to replace backup snapshot functionality with Restic snapshot and stats retrieval in `Home` and `Maintenance` pages.
- Enhanced Redux slice to manage Restic snapshots, stats, and tasks, including new actions for fetching and purging snapshots.
- Updated `clusterService.js` to include new Restic management functions.
- Created a new `dbhelper/map.go` file for managing PFS queries and plugins.
- Improved logging functionality in `restic.go` to support HTTP message logging.
…, and AddUnlockTask for improved task management
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.

2 participants