milvus/docs
wei liu 3b2526c7b6
fix: allocate new buildIDs for copy segments to prevent segmentBuildInfo corruption (#48163)
issue: https://github.com/milvus-io/milvus/issues/47658

## Summary

When restoring snapshots via copy segment, the source buildIDs were
reused directly, causing 1:1 map corruption in DataCoord's
`segmentBuildInfo`. This PR:

- Extends `CopySegmentTarget` proto with `new_build_ids` mapping
(`map<int64, int64>`)
- Allocates fresh buildIDs in DataCoord and passes them to DataNode
- DataNode replaces buildIDs in both index file paths and metadata
- Fixes indexID mismatch in `syncVectorScalarIndexes` by resolving
target collection's indexID via fieldID
- Shifts GC protection from indexID-based (`GetSnapshotByIndex`) to
buildID-based (`GetSnapshotByBuildID`) for precise file-level protection
- Updates snapshot user guide to reflect GC protection mechanism change

## Test plan

- [x] Unit tests updated for `copy_segment_meta`, `snapshot_meta`,
`copy_segment_task`
- [x] E2E test added: snapshot restore → drop → restore again flow
(`TestSnapshotRestoreDropRestoreAgain`)
- [ ] CI: ut-go, integration-test, e2e pass

Signed-off-by: Wei Liu <wei.liu@zilliz.com>

---------

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 15:13:29 +08:00
..
agent_guides/streaming-system
developer_guides
imgs
jaeger_guides
user_guides fix: allocate new buildIDs for copy segments to prevent segmentBuildInfo corruption (#48163) 2026-03-25 15:13:29 +08:00
OWNERS