Skip to content

enhance: recreate field indexes with safety checks - #536

Open
weiliu1031 wants to merge 1 commit into
mainfrom
feature/recreate-index
Open

enhance: recreate field indexes with safety checks#536
weiliu1031 wants to merge 1 commit into
mainfrom
feature/recreate-index

Conversation

@weiliu1031

Copy link
Copy Markdown
Collaborator

issue: #261

What changed

  • Add a dry-run-first recreate index command for a collection field.
  • Select the existing index explicitly when a field has multiple indexes.
  • Preserve the original index name and reported user parameters by default,
    or recreate it with AUTOINDEX through --auto-index.
  • Optionally release before dropping and reload after recreation through
    --release-and-load.
  • Add context-aware completion for collection, field, and index names.

Safety behavior

  • Refuse destructive execution while the collection is loaded unless
    release/reload was explicitly requested.
  • Require --confirm-default-load because automatic reload uses server-default
    settings and cannot preserve the previous replica count, resource groups,
    load fields, or dynamic-field behavior.
  • Warn during dry-run when DescribeIndex exposes only legacy fallback
    parameters that might not reproduce the original physical index.
  • Attempt to reload a released collection if index recreation fails.
  • Verify the recreated index parameters before reporting success.

Validation

  • gofmt on all changed Go files
  • git diff --check
  • go vet ./states/autocomplete ./internal/ops ./states/milvusctl
  • go build ./states/autocomplete ./internal/ops ./states/milvusctl
  • go build -o /tmp/birdwatcher-recreate-index cmd/birdwatcher/main.go

Unit tests were not run because the local Milvus binary required by the
mandatory reset workflow is unavailable.

issue: #261

Operators need a controlled way to rebuild an existing field index
without waiting for compaction. Add a dry-run-first command that reads
the selected index definition, preserves its name and user parameters,
then drops and recreates it only after explicit execution.

The command can opt into AUTOINDEX or release and reload the collection.
Reloading requires explicit acknowledgement because LoadCollection uses
server defaults instead of the previous load configuration. Completion
now resolves collections, fields, and index names from the connected
cluster.

Validation:
- gofmt on all changed Go files
- git diff --check
- go vet ./states/autocomplete ./internal/ops ./states/milvusctl
- go build ./states/autocomplete ./internal/ops ./states/milvusctl
- go build -o /tmp/birdwatcher-recreate-index
  cmd/birdwatcher/main.go
- Unit tests not run because the required local Milvus reset binary is
  unavailable.

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
@sre-ci-robot
sre-ci-robot requested a review from congqixia August 31, 2026 08:15
@sre-ci-robot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: weiliu1031
To complete the pull request process, please assign congqixia after the PR has been reviewed.
You can assign the PR to them by writing /assign @congqixia in a comment when ready.

The full list of commands accepted by this bot can be found 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

@mergify

mergify Bot commented Aug 31, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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.

2 participants