question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Query fails if one or more cluster nodes do not have records in the set

See original GitHub issue
query = 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:closed
  • Created 5 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jheckingcommented, Apr 30, 2018

This issue is fixed in aerospike@3.3.0.

1reaction
jheckingcommented, Apr 4, 2018

The replication factor is set to 2, does that not mean besides the master copy of data on one node, the replica happen on 2 other nodes?

Replication factor 2 means that a copy of the record gets stored on two cluster nodes, i.e. one master copy and one replica.

since the connection is not getting closed by the client I assume, why does it search for .foreach operation on a separate node all together?

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.

The same issue is persisting if I am connecting to one particular node using its IP instead of the cluster’ DNS, how so?

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.

.get, .exists works just fine shouldn’t that be a problem too or is it an explicit bug fir query.foreach ?

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found