Skip to content

feat: support remove import task#472

Merged
sre-ci-robot merged 4 commits intomilvus-io:mainfrom
bigsheeper:feat/import-task-removal
Mar 13, 2026
Merged

feat: support remove import task#472
sre-ci-robot merged 4 commits intomilvus-io:mainfrom
bigsheeper:feat/import-task-removal

Conversation

@bigsheeper
Copy link
Contributor

Summary

  • Add show import-task command to display individual tasks by task ID
  • Add remove import-task command to remove individual tasks by task ID
  • Add import-job alias to show bulkinsert for consistency
  • Enhance remove import-job to remove associated tasks by default
  • Add --without-tasks flag to preserve old remove import-job behavior

Implementation Details

  • New command: show import-task --task <taskID> - displays PreImportTask or ImportTaskV2
  • New command: remove import-task --task <taskID> - removes tasks with dry-run safety
  • New alias: show import-jobshow bulkinsert
  • Enhanced: remove import-job now removes job + tasks by default
  • Backwards compatibility: remove import-job --without-tasks preserves old behavior (job only)

Key Features

  • Auto-detects task type (PreImportTask or ImportTaskV2)
  • Dry-run mode by default for all remove commands (requires --run flag)
  • Proper context propagation for timeout handling
  • Comprehensive error handling with deletion summaries
  • Resilience pattern: continues on partial failures, reports summary

Technical Changes

Files Modified:

  • states/etcd/show/bulkinsert.go - Added ImportTaskParam and ShowImportTaskCommand
  • states/etcd/remove/bulkinsert.go - Added RemoveImportTaskParam, enhanced RemoveImportJobCommand
  • tests/e2e/commands/test_show.sh - Added e2e tests for show import-task
  • tests/e2e/commands/test_remove.sh - Added e2e tests for remove commands

Design & Plan:

  • docs/superpowers/specs/2026-03-10-import-task-removal-design.md
  • docs/superpowers/plans/2026-03-10-import-task-removal.md

Testing

All commands tested with:

  • Dry-run mode verification
  • Edge case handling (non-existent IDs, tasks in both collections)
  • Static code quality checks passed
  • All commits signed per DCO requirements

🤖 Generated with Claude Code

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>
@bigsheeper bigsheeper force-pushed the feat/import-task-removal branch from 65cac8a to 6d204dc Compare March 10, 2026 12:19
Copy link
Collaborator

@congqixia congqixia left a comment

Choose a reason for hiding this comment

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

/lgtm

@sre-ci-robot sre-ci-robot added the lgtm look good to me label Mar 13, 2026
@sre-ci-robot
Copy link
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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sre-ci-robot sre-ci-robot merged commit 79ce64f into milvus-io:main Mar 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants