Skip to content

Commit 6ac3aa1

Browse files
committed
docs(migration): document overlap detection in batch-plan
Add user-facing coverage for the new plan-time overlap check that batch-plan now performs: - Batch Migration > Batch Plan Review: short note explaining that batch-plan refuses overlapping prefixes and pointing at the troubleshooting entry. - Troubleshooting: new 'overlapping indexes detected' entry with the verbatim error output the operator will see and the resolution (split into prefix-disjoint groups, one batch-plan per group).
1 parent 7dc7b86 commit 6ac3aa1

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

docs/user_guide/how_to_guides/migrate-indexes.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,35 @@ The index is taking longer to rebuild than expected. This can happen with large
717717

718718
Documents were added or removed between plan and apply. This is expected if your application is actively writing. Re-run `plan` and `apply` during a quieter period when the document count is stable, or verify the mismatch is due only to normal application traffic.
719719

720+
### batch-plan failed: "overlapping indexes detected"
721+
722+
`batch-plan` refuses to write a plan when two or more applicable indexes
723+
share a key prefix (one prefix is a literal string-prefix of the other,
724+
matching `FT.CREATE PREFIX` semantics). Running such a batch would
725+
double-quantize the shared keys and corrupt vector data. The error lists
726+
each conflicting index pair under a `Conflicts:` section:
727+
728+
```
729+
Error: Refusing to create batch plan: overlapping indexes detected.
730+
731+
Multiple indexes in the batch share Redis key prefixes. Running a
732+
batch migration over overlapping indexes can mutate the same keys
733+
more than once (e.g., double-quantization of vectors), corrupting
734+
the underlying data.
735+
736+
Conflicts:
737+
- products_main <-> products_premium: 'product:' <-> 'product:premium:'
738+
739+
Resolve by migrating overlapping indexes one at a time, or by
740+
narrowing the batch to a set of indexes with disjoint prefixes.
741+
```
742+
743+
Split the selected indexes into prefix-disjoint groups (for example,
744+
`prod_*` separately from `staging_*`) and run `batch-plan` once per group.
745+
Indexes that are skipped for other reasons (e.g. `applicable: false`
746+
because a field is missing) do not participate in this check.
747+
748+
720749
### How to recover from a failed migration
721750

722751
If `apply` fails mid-migration:
@@ -1000,6 +1029,16 @@ created_at: "2026-03-20T10:00:00Z"
10001029
- `applicable: true` means the patch applies to this index
10011030
- `skip_reason` explains why an index will be skipped
10021031

1032+
**Overlap check.** `batch-plan` refuses to write a plan when two applicable
1033+
indexes have key prefixes that overlap — i.e. one prefix is a literal
1034+
string-prefix of the other, matching `FT.CREATE PREFIX` semantics. Migrating
1035+
overlapping indexes in a single batch can corrupt vector data because every
1036+
index after the first reads bytes that an earlier index has already
1037+
quantized. Split the indexes into prefix-disjoint groups and create a batch
1038+
plan per group. See the troubleshooting entry below for the exact error
1039+
message.
1040+
1041+
10031042
### Applying a Batch Plan
10041043

10051044
```bash

0 commit comments

Comments
 (0)