feat: support remove import task#472
Merged
sre-ci-robot merged 4 commits intomilvus-io:mainfrom Mar 13, 2026
Merged
Conversation
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
- Add ImportTaskParam struct for command parameters - Add ShowImportTaskCommand method to display task by ID - Auto-detect task type (PreImportTask or ImportTaskV2) - Handle edge case where task exists in both collections - Add e2e tests for show import-task command Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Add new command `remove import-task --task <taskID>` that removes individual import tasks (PreImportTask or ImportTaskV2) from etcd. Changes: - Add RemoveImportTaskParam struct with task parameter - Add RemoveImportTaskCommand method to ComponentRemove - Search and remove from both PreImportTask and ImportTaskV2 collections - Display task details before removal for confirmation - Support dry-run mode (default) and actual deletion with --run flag - Add e2e test for remove import-task command - Use proper context propagation for timeout handling - Return errors on deletion failure (matching existing patterns) This implements Task 3 of the import-task-removal feature as specified in docs/superpowers/specs/2026-03-10-import-task-removal-design.md Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Add --without-tasks flag to enhance remove import-job command. Default behavior now removes import jobs along with their associated tasks (PreImportTasks and ImportTaskV2). The new --without-tasks flag preserves the old behavior of removing only the job. Key changes: - Add WithoutTasks field to RemoveImportJobParam struct - Enhance RemoveImportJobCommand to query and remove associated tasks by default - Implement resilience pattern: continue on individual task deletion failures - Deletion order: PreImportTasks -> ImportTaskV2 -> Job - Display summary of what will be removed before deletion - Fix context usage: use passed ctx instead of context.Background() - Always print deletion summary, even if job deletion fails - Return aggregate errors indicating both task and job deletion status When --without-tasks is set, only the job is deleted (old behavior). When --without-tasks is not set, both job and tasks are deleted (new default). Error handling ensures users always see task deletion summary before any error is returned, providing full visibility into partial failures. Test coverage: - Add e2e test for --without-tasks flag in dry-run mode This implements Task 4 of the import-task-removal feature as specified in docs/superpowers/specs/2026-03-10-import-task-removal-design.md Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
65cac8a to
6d204dc
Compare
Collaborator
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bigsheeper, congqixia The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
show import-taskcommand to display individual tasks by task IDremove import-taskcommand to remove individual tasks by task IDimport-jobalias toshow bulkinsertfor consistencyremove import-jobto remove associated tasks by default--without-tasksflag to preserve oldremove import-jobbehaviorImplementation Details
show import-task --task <taskID>- displays PreImportTask or ImportTaskV2remove import-task --task <taskID>- removes tasks with dry-run safetyshow import-job→show bulkinsertremove import-jobnow removes job + tasks by defaultremove import-job --without-taskspreserves old behavior (job only)Key Features
--runflag)Technical Changes
Files Modified:
states/etcd/show/bulkinsert.go- Added ImportTaskParam and ShowImportTaskCommandstates/etcd/remove/bulkinsert.go- Added RemoveImportTaskParam, enhanced RemoveImportJobCommandtests/e2e/commands/test_show.sh- Added e2e tests for show import-tasktests/e2e/commands/test_remove.sh- Added e2e tests for remove commandsDesign & Plan:
docs/superpowers/specs/2026-03-10-import-task-removal-design.mddocs/superpowers/plans/2026-03-10-import-task-removal.mdTesting
All commands tested with:
🤖 Generated with Claude Code