Connection reset


I’m using Aerospike Community Version 3.12.1 and Java Client 3.3.4 (spring-data-aerospike 1.0.2).

When I try to delete huge record (about 100,000) by deleteAll() method on AerospikeRepository, the client throw Exception like blow.

org.springframework.dao.RecoverableDataAccessException: Aerospike Error: Connection reset; nested exception is com.aerospike.client.AerospikeException: Connection reset

at at at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( at sun.reflect.DelegatingMethodAccessorImpl.invoke( at java.lang.reflect.Method.invoke( at$QueryExecutorMethodInterceptor.executeMethodOn( at$QueryExecutorMethodInterceptor.doInvoke( at$QueryExecutorMethodInterceptor.invoke( …

For a some minute, it works good. But after about 3 minute, the Exception occured.

Here is my client Setting.

@Bean(destroyMethod = “close”) public AerospikeClient aerospikeClient() {

    ClientPolicy policy = new ClientPolicy();
    policy.failIfNotConnected = true;
    policy.timeout = 10000;
    policy.tendInterval = 3000;
    policy.connPoolsPerNode = 5;
    policy.threadPool = Executors.newFixedThreadPool(5, runnable -> {
                                        Thread thread = new Thread(runnable);
                                        return thread;
    return new AerospikeClient(policy, aerospikeHost, aerospikePort);
public AerospikeTemplate aerospikeTemplate() {
    return new AerospikeTemplate(aerospikeClient(), aerospikeNamespace);

And this is my Server Configuration.

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/ proto-fd-max 15000 }

logging {

Log file must be an absolute path.

file /var/log/aerospike/aerospike.log { context any info } }

network { service { address any port 3000 }

heartbeat { mode mesh address any port 3002

  mesh-seed-address-port 3002
  interval 150
  timeout 10


fabric { port 3001 }

info { port 3003 } }

namespace trendingo { replication-factor 2 memory-size 4G default-ttl 30d # 30 days, use 0 to never expire/evict.

storage-engine device { device /dev/xvdb #data-in-memory true # Store data in memory in addition to file. write-block-size 128K # adjust block size to make it efficient for SSDs. scheduler-mode noop } }

Is there anybody know the reason or solution?

The current version of spring-data-aerospike doesn’t use set truncate to delete all the records from the set. This will be included in the next release.

In the meantime, you can follow these instructions to manually truncate the set.

Thank you for your kind response.

BTW can I use asinfo at aql?

Or is there other operation in aql for same action (truncate set)??

aql currently doesn’t support set truncate, so for now you can either use asinfo to do the truncate or use the api in one of our clients. Since you are using spring-data, you might be interested in the Java client’s API for truncate.

This topic was automatically closed 84 days after the last reply. New replies are no longer allowed.