AerospikeError Operation not allowed at this time while doing only reads

510 Views Asked by At

I am trying to load test my code with 50 parallel read requests.

I am querying data based on multiple indexes that I have created. Code looks something like this:

const fetchRecords = async (predicates) => {
  let query = aeroClient.query('test', 'mySet');

  let filters = [
      predexp.stringValue(predicates.load),
      predexp.stringBin('load'),
      predexp.stringEqual(),
      predexp.stringValue(predicates.disc),
      predexp.stringBin('disc'),
      predexp.stringEqual(),
      predexp.integerBin('date1'),
      predexp.integerValue(predicates.date2),
      predexp.integerGreaterEq(),
      predexp.integerBin('date2'),
      predexp.integerValue(predicates.date2),
      predexp.integerLessEq(),
      predexp.stringValue(predicates.column3),
      predexp.stringBin('column3'),
      predexp.stringEqual(),
      predexp.and(5),
  ]
  query.where(filters);

  let records = [];
  let stream = query.foreach();
  stream.on('data', record => {
      records.push(record); 
  })
  stream.on('error', error => { throw error });
  await new Promise((resolve, reject) => {
      stream.on('end', () => resolve());
  });
  return records;
}

This fails and I get the following error:

 AerospikeError: Operation not allowed at this time.
    at Function.fromASError (/Users/.../node_modules/aerospike/lib/error.js:113:21)
    at QueryCommand.convertError (/Users/.../node_modules/aerospike/lib/commands/command.js:91:27)
    at QueryCommand.convertResponse (/Users/.../node_modules/aerospike/lib/commands/command.js:101:24)
    at asCallback (/Users/.../node_modules/aerospike/lib/commands/command.js:163:24)

My aerospike.conf content:

service {
    user root
    group root
    paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
    pidfile /var/run/aerospike/asd.pid
#   service-threads 6 # cpu x 5 in 4.7 
#   transaction-queues 6 # obsolete in 4.7 
#   transaction-threads-per-queue 4 # obsolete in 4.7
    proto-fd-max 15000
}
<...trimmed section>
namespace test {
    replication-factor 2
    memory-size 1G
    default-ttl 30d # 5 days, use 0 to never expire/evict.
    nsup-period 120
    #   storage-engine memory

    # To use file storage backing, comment out the line above and use the
    # following lines instead.

    storage-engine device {
        file /opt/aerospike/data/test.dat
        filesize 4G
        data-in-memory true # Store data in memory in addition to file.
    }
}

From a similar question I found that this is happening due to low system configurations. How can I modify these. Also, I believe 50 requests should have worked, given I was able to insert around 12K records/sec.

1

There are 1 best solutions below

3
On

Those are scans I guess rather than individual reads. To increase the scan-threads-limit:

asinfo -v "set-config:context=service;scan-threads-limit=128"