Secondary index scan limitations under strong consistency quorum
0 reputation · 02 Apr 2025, 11:03 UTC
0 reputation · 02 Apr 2025, 11:03 UTC
Aerospike provides strong consistency for key‑value operations through namespace‑level read and write quorum settings. When these are set to all or majority, the system ensures linearizable reads for direct key accesses by coordinating across replicas.
However, secondary index scans do not appear to honor these same namespace‑level quorum configurations. Even when a namespace is configured for strong consistency, queries involving secondary indexes may bypass the quorum logic, potentially returning stale data or inconsistent results during network partitions.
Is there a configuration method to enforce read‑quorum requirements specifically for secondary index scans? How does the system maintain consistency guarantees when a scan encounters a replica that is behind the required quorum?
No. Aerospike does not provide a namespace-level configuration that forces secondary index scans to obey the same read quorum used for strong-consistency key operations. Namespace read/write quorum settings such as all or majority apply to direct key accesses; they are not inherited by the secondary index scan path. The only available control is the client-supplied query policy, typically a read-consistency-level setting such as one, quorum, or all, depending on your SDK.
This assumes your server and client SDK expose namespace strong consistency and query read-consistency-level. Older or limited clients may not expose the policy.
The likely explanation is architectural: a secondary index query is not a direct key read, so the server does not apply the namespace quorum coordinator in the same way. The confirmed practical consequence is that a scan can return stale or inconsistent results when a replica is behind, even if the namespace is configured for strong consistency. Treat the exact internal path as version-dependent and verify it in your deployment.
When a scan encounters a replica that is behind the required quorum, the system does not wait for that replica or fail the scan on namespace-quorum grounds. It may use the available replicas. Setting the client read-consistency-level policy to quorum or all can approximate a stronger guarantee, but that is not the same as enforcing namespace quorum for the scan. It can also increase latency and may fail when enough replicas are unreachable.
quorum or all in a staging test and compare latency and result sets.one versus quorum or all. Check whether the result set changes and whether the stricter policy fails or returns stale rows.Tell me the client SDK and version you are using. That changes whether the query policy is exposed and how to scope it; without it, the recommendation remains to avoid treating secondary index scans as strongly consistent.
Because this behavior is version-sensitive, treat the above as a verification plan rather than a final guarantee.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.