Conversation
… failing when write_consistency_factor exceeds target peers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
recover_snap_shardsrefused every collection whosewrite_consistency_factorexceeded the target's peer count (capacity gate failed: write_consistency_factor=2 > target peers=1). On CST-397 this skipped all 69 collections when restoring into a single-node target: our document-index chart setswrite_consistency_factor: 2server-wide, so every manifest carries 2.The premise was wrong. Qdrant places
min(RF, peers)replicas per shard and requiresmin(wcf, placed replicas)acks per write (shard_distribution.rs,replica_set/update.rs, identical in 1.15.1, 1.16.0 and dev), so the collection is created writable. The gate now warns and proceeds, mirroring the existingpeers < replication_factorbranch.How it works
One file, +3/−4: the
wcf > peersbranch ofcheck_capacity_gateprints a WARNING instead ofreturn 8; the function header comment states the real semantics. rc 8 remains for non-numeric input. Restored collections keep the manifest'sreplication_factor/write_consistency_factor, so the intended durability applies once peers are added.Guarantees & caveats
min(RF, peers)replicas until peers join; both shortfalls are logged as WARNINGs.tests/test_gates.shexpects rc 8 forcheck_capacity_gate 4 3 3; one-line flip prepared).Testing
qdrant/qdrant:v1.15.1(cluster mode on) with awcf=2, rf=2backup: reproduces the customer's exact error, exit 1, target untouched.VERIFIED (points=300, manifest=300), exit 0; collection green, rf/wcf preserved, payload index restored, both shards Active, upsert accepted.