Skip to content

Have kdrant migrate create the collection it migrates into - #116

Merged
tonytonycoder11 merged 2 commits into
mainfrom
fix/cli-migrate-creates-its-target
Aug 6, 2026
Merged

Have kdrant migrate create the collection it migrates into#116
tonytonycoder11 merged 2 commits into
mainfrom
fix/cli-migrate-creates-its-target

Conversation

@tonytonycoder11

Copy link
Copy Markdown
Contributor

The v2.2.0 tag was pushed and the release stopped where it was supposed to stop.

kdrant migrate cli-source cli-target failed with the target collection 'cli-target' does not exist,
which is true of every collection nobody has made yet and therefore of the whole command. Nothing was
published: the publish job has needs: cli, so the binaries are built and proven against a real
Qdrant before any jar reaches Maven Central. There is no 2.2.0 on Central and no GitHub Release.

The fix

kdrant migrate creates the target from the source's own vectors. Asking the person at a terminal to
restate a vector size and a distance they did not choose is asking them to get one wrong, and a
migration that does not re-embed keeps the same vectors by definition. --shards and --replicas
override, which is what turns a copy into the re-shard the help text was already promising.

What is deliberately not carried across is HNSW tuning, quantization and optimizer settings. Those were
changed on the source for a layout the target may not have, and copying them onto a collection that is
about to be re-sharded carries a decision made for something else.

Why it took a release build to find it

Because nothing below that level could. ArgumentsTest covers the flags, and the flags were right. The
kdrant-cli module has no integration test of its own, so the first thing that ran the command end to
end was the release workflow, which is the last line of defence and should not have been the first.

So the decision is now a function of its inputs rather than a lambda that writes into a builder, and
MigrateTargetTest asserts it without needing a Qdrant to write to: sizes, distances, on-disk storage,
named vectors, a multi-vector comparator and a sparse IDF modifier all have to arrive intact, and the
tuning has to not.

After this merges

The v2.2.0 tag points at a commit without this fix and published nothing, so it moves to the new merge
commit rather than becoming a 2.2.1 for a release that never existed. The changelog entry for M49 says
what the command does now.

The first release build caught it: the migration refused because the target
did not exist, which is true of every collection nobody has made yet and
therefore of the whole command. The workflow builds the binaries and proves
them against a real Qdrant before anything is published, so nothing shipped.

The target is created from the source's own vectors rather than from a size
and a distance the person at the terminal did not choose. --shards and
--replicas override, which is what turns a copy into the re-shard the help
text was already promising.

The decision is a function of its inputs rather than a lambda that writes into
a builder, so it is asserted without a Qdrant to write to: sizes, distances,
storage, named vectors, a multi-vector comparator and a sparse modifier all
have to arrive intact. HNSW, quantization and optimizer settings deliberately
do not, because they were tuned for a layout the target may not have.
@tonytonycoder11
tonytonycoder11 requested a review from a team as a code owner August 6, 2026 07:45
@trueup-by-nacode-studios

trueup-by-nacode-studios Bot commented Aug 6, 2026

Copy link
Copy Markdown

This pull request adds no capability the code did not already have.

4 files read · 3227 ms · against 23fa012

@tonytonycoder11
tonytonycoder11 merged commit f1d37cc into main Aug 6, 2026
12 checks passed
@tonytonycoder11
tonytonycoder11 deleted the fix/cli-migrate-creates-its-target branch August 6, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant