Questions
10 of 14
1What is a segment in Qdrant's storage engine, and why does a collection consist of multiple segments rather than one monolithic index?
2What role does the Write-Ahead Log (WAL) play in Qdrant, and what failure scenario does it protect against?
3How does memory-mapped (mmap) storage allow Qdrant to serve a collection larger than available RAM?
4What does the background optimizer do in Qdrant, and why can too-aggressive optimization affect query latency?
5What is the practical difference between storing vectors in-memory versus on-disk in a collection configuration, and when would you choose on-disk?
6What is sharding in a distributed Qdrant cluster, and what determines which shard a given point is written to by default?
7What is custom sharding, and how does it change the way multitenant data is distributed across a cluster?
8What consensus algorithm does Qdrant use to keep cluster metadata consistent across nodes, and what does it coordinate?
9What are Qdrant's tunable read/write consistency levels for distributed operations, and what trade-off do they represent?
10In a replicated cluster, what happens to search results if a query is served while one replica of a shard is temporarily out of sync?
11Walk through what happens internally, at a high level, when a client sends a filtered vector search request to a distributed Qdrant cluster.
12Why does Qdrant merge and re-rank results from multiple shards rather than simply concatenating each shard's top-k?
13How does a payload filter interact with segment selection during query execution - does Qdrant always scan every segment?
14What is the performance implication of running a query that touches every named vector on a point versus one that specifies using?
10 / 14

In a replicated cluster, what happens to search results if a query is served while one replica of a shard is temporarily out of sync?

Staleness depends on the read consistency level of the query

If a query is served by a replica that is behind the primary, the client may see stale results - missing points that were recently upserted, or including points that were recently deleted - and this is expected behavior in an eventually consistent system, not a bug. What the client actually sees depends entirely on the read consistency level of the query. With consistency=one, the query is sent to any healthy replica, and if that replica is lagging, the result will be stale. With consistency=majority, the coordinator queries a majority of replicas, compares their states (typically by version or operation number), and returns the freshest consistent view; a single lagging replica does not corrupt the result as long as the majority is up to date. With consistency=all, every replica must respond and the coordinator reconciles, so the result reflects the latest state across all replicas, but a single lagging or unreachable replica causes the query to fail or time out.

The mechanism behind this is that replicas catch up asynchronously via the WAL stream from the primary. There is no bound on how far behind a replica can be at any given moment; it can be milliseconds behind under normal operation or seconds to minutes behind if it is overloaded, network-partitioned, or recovering from a restart. Qdrant tracks per-shard versions so it can detect lag and reconcile when a query uses a stronger consistency level, but with consistency=one it does not attempt to reconcile - it just returns whatever the chosen replica has. The practical implication is that read-your-write is not guaranteed with the default permissive consistency, even though it may appear to work most of the time. The failure mode is intermittent and load-dependent, which makes it hard to debug. If your application upserts a point and then searches for it, and the search happens to route to a lagging replica, the point will not appear, and the user will report a bug that you cannot reproduce.

  1. 1

    consistency=one: query any healthy replica; stale results possible if that replica is behind.

  2. 2

    consistency=quorum/majority: query multiple replicas and reconcile; tolerant of a single lagging replica.

  3. 3

    consistency=all: query every replica; freshest result but fails if any replica is down or slow.

  4. 4

    Replica lag is normal: replicas catch up via WAL streaming, and lag can spike under load or after a restart.

  5. 5

    Read-your-write: not guaranteed by default; requires wait=true on the write, a stronger read consistency, or both.

The trade-off is freshness against latency and availability. Stronger read consistency reduces staleness but costs a round trip to more replicas and makes queries fail when a replica is unhealthy. For most search workloads, consistency=one is the right default because a slightly stale index is acceptable and tail latency matters. For read-your-write scenarios - a user submits a document and then searches for it - you need either wait=true on the write or consistency=majority on the read, or both. The common mistake is assuming that a successful upsert with wait=true guarantees subsequent searches will see the point. It does not if the search is served by a replica that has not yet consumed the WAL entry, unless the read consistency forces reconciliation. The second mistake is setting consistency=all to fix staleness and then discovering that a single slow replica makes every query time out. The third mistake is treating replica lag as an anomaly to be eliminated. It is a normal property of an asynchronous replication system; the right response is to choose consistency levels that match the application's freshness requirements, not to try to make lag zero. Version note: the exact behavior of reconciliation under consistency=majority (what it compares, how it merges) has changed across releases, and the set of consistency levels supported differs. Verify on your version, and test with an artificially lagged replica rather than assuming.

javascript

Version-dependent: the replication reconciliation logic and the supported consistency levels have changed across releases. In some versions, consistency=majority compares operation numbers and returns the freshest; in others, the reconciliation is coarser. The behavior during a primary failover - specifically, whether a newly promoted primary may have missed writes that the old primary had acknowledged - depends on the write consistency factor and on the version's recovery logic. If read-your-write is a hard requirement, design it explicitly with wait=true and a stronger read consistency, and test it under replica lag and failover rather than relying on defaults.

Difficulty: 8/10
Topics: Consistency, Replication, Eventual Consistency

Scenario Questions

0-2 years experience
  1. 1

    A user reports that a document they just uploaded is not showing up in search, but it appears a few seconds later. Explain what is happening.

  2. 2

    A teammate says the replica must be broken because it is missing a recent write. Explain why this is expected behavior.

2-5 years experience
  1. 1

    You see intermittent missing results under high load but not under low load. Diagnose how replica lag could cause this and how you would confirm it.

  2. 2

    You need to guarantee that an admin audit query always sees the latest data. What consistency level do you use, and what happens if one replica is down?

5-8 years experience
  1. 1

    Design a monitoring strategy that detects replica lag before it affects user-visible freshness, including the metrics you would track and the alerts you would set.

  2. 2

    Your application has a mix of read-your-write and best-effort search endpoints. Describe how you would route each to the appropriate consistency level and measure the latency impact.

8+ years experience
  1. 1

    Derive the probability that a read-your-write violation occurs as a function of write rate, replica lag distribution, and consistency level. How would you use the model to set an SLA?

  2. 2

    You must guarantee read-your-write across a multi-region deployment without using consistency=all. Describe the design, including how you handle region failover and network partitions.

Follow-up Questions

  • How would you reproduce and test replica lag in a staging environment to validate your consistency choices before production?
  • What happens to in-flight reads during a primary failover, and how would you ensure the application does not see a regression in freshness during the transition?