-
Notifications
You must be signed in to change notification settings - Fork 172
Feat: Enhance Restic backup management with flexible tagging and restore endpoints #1328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
…e, dump, mount, and unmount
…e, dump, mount, and unmount
…ionForm components for enhanced backup management UI
- Implemented ResticListSnapshot and ResticRestoreSnapshot methods in the Cluster struct. - Added corresponding API handlers in the ReplicationManager for listing and restoring snapshots. - Enhanced ConfirmActionForm component to handle snapshot restoration with specific paths and target directories. - Updated SnapshotTables component to include restore functionality for snapshots. - Introduced utility functions for normalizing paths and filtering entries based on base paths. - Added Redux actions and service methods for interacting with the new snapshot listing and restoration features.
…nd layout adjustments
…ories with UI integration
…on with normalization logic
PR Review: Enhanced Restic Backup ManagementSummaryThis PR adds significant enhancements to Restic backup management, including flexible tagging, purge grouping configuration, and new REST API endpoints for snapshot listing and restoration. The changes are well-structured and comprehensive. ✅ Strengths
|
| Issue | Severity | Type |
|---|---|---|
| CancelTask() array indexing bug | HIGH | Bug |
| Path traversal in restore endpoint | MEDIUM | Security |
| GenerateTaskID() thread safety | MEDIUM | Concurrency |
| Error format string in RunCommand | LOW | Bug |
| Add CLI flags for new config options | LOW | Feature |
Recommendations for Follow-up
- Add integration tests for tag building with various config combinations
- Add stress tests for task queue operations
- Document the purge group-by and tag category options in config documentation
- Add validation for absolute paths in restore operations
Overall Assessment: The PR introduces valuable functionality with mostly solid implementation. The main concerns are the task ID indexing bug in CancelTask() and missing input validation in the restore endpoint. These should be addressed before merging. The test suite is comprehensive, but could benefit from additional edge case coverage.
…in Restic operations
… of boolean in Restic purge
|
@claude review my pull request |
|
Claude encountered an error after 26s —— View job I'll analyze this and get back to you. |
|
@claude review my pull request |
|
Claude encountered an error after 17s —— View job I'll analyze this and get back to you. |
- Implemented TestFailoverResticDump, TestResticDumpRestore, and TestResticSnapshotAndDump in regtest/test_failover_restic_dump.go to validate restic dump and restore processes. - Added API endpoint for dumping restic snapshots to MySQL in server/api_cluster.go. - Created SnapshotDumpForm component in ConfirmActionForm.jsx for user input on server and file path during dump operations. - Enhanced SnapshotTables.jsx to include a button for initiating the dump to MySQL action. - Updated Maintenance component to handle snapshot dump actions and manage state for dump files. - Modified ConfirmModal to accept a size prop for better UI handling. - Improved styling in ConfirmModal's styles.module.scss for better visual hierarchy. - Added resticDumpToMysql action in clusterSlice.js to handle the dump request. - Updated globalClustersSlice.js to maintain pending thunk states. - Integrated resticDumpToMysql service in clusterService.js for API interaction.
- Enhanced ClusterDBTabContent and DBServerGrid components to include backupRestic configuration. - Implemented advanced backup modal in ServerMenu for selecting backup type (logical/physical) and line (default/adhoc). - Added retention days and Restic toggle options for ad-hoc backups. - Updated Redux actions to support options for physical and logical backups. - Modified clusterService to build query parameters for backup requests. - Enhanced ResticManager to return snapshot IDs and handle backup command output more efficiently. - Added tests for SnapshotDumpForm to ensure proper functionality and user interactions.
- Add backup line selection (default/adhoc) to reseed operations - Implement Advanced Reseed modal with reseed type, source, and line selection - Add Point-In-Time Recovery (PITR) modal with backup selection and timestamp - Update backend API to accept 'line' query parameter for reseed endpoints - Maintain backward compatibility with existing reseed functionality Backend changes: - server/api_database.go: Parse backup line options for reseed operations Frontend changes: - services/clusterService.js: Add PITR service and update reseed services - redux/clusterSlice.js: Add PITR thunk and update reseed thunks - ServerMenu.jsx: Implement Advanced Reseed and PITR modals
- Implemented a new API endpoint for reseeding a server from a RESTIC snapshot in `api_database.go`. - Added a new handler `handlerMuxServerReseedRestic` to process RESTIC reseed requests, including parameter validation and error handling. - Updated the React dashboard to include RESTIC snapshot options in the server menu, allowing users to select snapshots and specify restore modes. - Introduced Redux actions and service functions for handling RESTIC reseed operations in `clusterSlice.js` and `clusterService.js`. - Enhanced the RESTIC manager with a synchronous restore function to facilitate the new reseed process.
…eseed - Added BackupID field to BackupRunOptions in backup_helpers.go. - Introduced reseedLogicalBackupByID method in srv_job.go for logical backup reseeding by ID. - Updated API to handle backup ID in api_backup_options.go and api_database.go. - Enhanced ServerMenu component in ServerMenu.jsx to support ad-hoc backup selection by ID. - Modified clusterSlice.js and clusterService.js to include useSourcePath parameter for restic reseed operations.
…ime Recovery (PITR) options
This pull request introduces significant enhancements and configurability to the Restic backup integration, focusing on flexible tagging, purge grouping, and new API endpoints for snapshot management. The changes allow users to customize how backups are tagged and grouped, and provide new REST endpoints to list and restore Restic snapshots. Several internal helper functions and configuration settings were added to support these features, and existing backup flows were refactored to use the new tagging mechanism.
Restic Tagging and Purge Grouping Improvements:
BackupResticTagCategoriesandBackupResticPurgeGroupByto theConfigstruct, with corresponding CLI flags and setters, allowing users to customize backup tag categories and purge grouping behavior. [1] [2] [3] [4]BuildResticTagsmethod, which generates tags based on the configured categories, improving consistency and flexibility. [1] [2] [3] [4] [5]Restic Snapshot Management API:
/api/clusters/{clusterName}/restic/ls/{snapshotID}) and restore (/api/clusters/{clusterName}/restic/restore/{snapshotID}) Restic snapshots, with corresponding handler implementations and request/response types. [1] [2] [3]Restic Purge Enhancements:
groupByvalue from configuration, with validation and fallback to default on error, allowing for more granular retention policies. [1] [2]Miscellaneous:
io,strings) to support new functionality.These changes collectively provide a more flexible and powerful Restic backup experience, making it easier to manage, tag, and restore backups according to organizational needs.