Query fails if one or more cluster nodes do not have records in the set
See original GitHub issuequery = CLIENT.query(NAMESPACE, SET);
stream = query.foreach();
/*
Get list of all avialable keys
*/
stream.on('error', (error) => {
throw error;
});
stream.on('data', (record) => {
console.info('data', record);
console.info('key', record.key.key);
});
stream.on('end', () => {
console.log('done!');
process.exit(0);
});
Receiving error - AerospikeError: Record does not exist in database. May be returned by read, or write with policy Aerospike.policy.exists.UPDATE.
error encountered in promise chain => { [AerospikeError: Record does not exist in database. May be returned by read, or write with policy Aerospike.policy.exists.UPDATE]
name: 'AerospikeError',
code: 2,
command:
QueryCommand {
client:
Client {
domain: null,
_events: {},
_eventsCount: 0,
_maxListeners: undefined,
config: [Object],
as_client: AerospikeClient {},
connected: true,
captureStackTraces: false },
args: [ 'sms_data', 'some_set', [Object], undefined ],
captureStackTraces: false,
key: undefined,
stream:
RecordStream {
aborted: false,
client: [Object],
_events: [Object],
_eventsCount: 3 } },
func: 'as_query_parse_records_async',
file: 'src/main/aerospike/aerospike_query.c',
line: 237,
inDoubt: false }
Although the data is present in the namespace and set.
query result :
aql> select * from sms_data.some_set;
+-----------------------------------------------------+----------+
| 0 | name |
+-----------------------------------------------------+----------+
| MAP('{"dummy":[{"x":"dgjasgdj"}], "name":"Vidur"}') | "Khanna" |
+-----------------------------------------------------+----------+
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Aerospike Query Error - node.js - Stack Overflow
The short version is, that this occurs on Query operations, if at least one server node in the cluster does not have any...
Read more >Windows Server 2016 Cluster DNS Errors - Microsoft Q&A
Make sure that all cluster nodes and the cluster account have permission to update the relevant zones and records in DNS. Here's an...
Read more >Create a cluster name object and solve cluster connection ...
Usually, you address failover clusters not through their nodes but rather via the cluster name object (CNO) in Active Directory.
Read more >Fix common cluster issues | Elasticsearch Guide [8.5] | Elastic
This error indicates a data node is critically low on disk space and has reached the flood-stage disk usage watermark. Circuit breaker errors:...
Read more >Resolving Error "Failed to discover cluster address for cluster ...
This error is triggered when a PowerShell "discovery" script, designed to retrieve information about the Windows Cluster, receives an unexpected ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This issue is fixed in
aerospike@3.3.0.Replication factor 2 means that a copy of the record gets stored on two cluster nodes, i.e. one master copy and one replica.
For query operations, the client needs to send the request to every node in the cluster since it does not know which node might have records that match the query filter.
Even if you are just connecting to a single node via it’s IP, the client will find out about the rest of the cluster from this initial seed node and connect to all the cluster nodes.
For single-key operations, the client determines which node holds the master copy of that record based on the key digest, and then sends the request to only that particular node.