Failing understanding Truncate-Namespace command

Hi. I am using Aerospike CE 4.7.0.2 for my APIs and I am having troubles with data truncation. I read the documentation and I know that Aerospike needs a cold-restart in order to actually delete data but this is not happening.

In our API, we use the Go client and according to the codebase, the truncate-namespace is supported. Despite it is called successfully, the data is actually there and not mutated whatsoever. So I tried to run the truncate-namespace manually with asinfo but it’s still not working. I wonder what I am doing wrong.

I also tried to cold-restart the database but nothing seems working. Could you kindly explain why I am having this situation. Here below there are some steps that I’ve taken without success.

$: asinfo -v "truncate-namespace:namespace=test;"
ok

$: aql
Seed:         127.0.0.1
User:         None
Config File:  /etc/aerospike/astools.conf /root/.aerospike/astools.conf
Aerospike Query Client
Version 3.21.1
C Client Version 4.6.5
Copyright 2012-2019 Aerospike. All rights reserved.

aql> show sets
+------------------+--------+----------------+---------+-------------------+--------------------+-------------------+--------------+------------+
| disable-eviction | ns     | set-enable-xdr | objects | stop-writes-count | set                | memory_data_bytes | truncate_lut | tombstones |
+------------------+--------+----------------+---------+-------------------+--------------------+-------------------+--------------+------------+
| "false"          | "test" | "use-default"  | "0"     | "0"               | "test"             | "0"               | "0"          | "0"        |
| "false"          | "test" | "use-default"  | "0"     | "0"               | "models"           | "0"               | "0"          | "0"        |
| "false"          | "test" | "use-default"  | "0"     | "0"               | "testSetName"      | "0"               | "0"          | "0"        |
| "false"          | "test" | "use-default"  | "0"     | "0"               | "model_1"          | "0"               | "0"          | "0"        |
| "false"          | "test" | "use-default"  | "0"     | "0"               | "model_2"          | "0"               | "0"          | "0"        |
| "false"          | "test" | "use-default"  | "0"     | "0"               | "collaborative"    | "0"               | "0"          | "0"        |
+------------------+--------+----------------+---------+-------------------+--------------------+-------------------+--------------+------------+
[127.0.0.1:3000] 30 rows in set (0.002 secs)

OK

aql> exit

root@3f40569ae224:/# exit
exit

The configuration looks like the following

# Testing configuration for Aerospike
service {
	user root
	group root
}

logging {

	# Send log messages to stdout
	console {
		context any info
	}
}

network {
	service {
		address any
		port 3000

		# Uncomment the following to set the `access-address` parameter to the
		# IP address of the Docker host. This will the allow the server to correctly
		# publish the address which applications and other nodes in the cluster to
		# use when addressing this node.
		# access-address <IPADDR>
	}

	heartbeat {

        address any
		# mesh is used for environments that do not support multicast
		mode mesh
		port 3002

		# use asinfo -v 'tip:host=<ADDR>;port=3002' to inform cluster of
		# other mesh nodes

		interval 150
		timeout 10
	}

	fabric {
	    address any
		port 3001
	}

	info {
	    address any
		port 3003
	}
}

namespace phoenix {
	replication-factor 1
	memory-size 3G
	default-ttl 0
	storage-engine device {
		file /opt/aerospike/data/phoenix.dat
		filesize 4G
	}
}

namespace test {
	replication-factor 1
	memory-size 1G
	default-ttl 0
	storage-engine device {
		file /opt/aerospike/data/test.dat
		filesize 2G
	}
}

I really do not understand what I am doing wrong. I just want to erase the namespace:test so I can re-run my tests from a clean state. How can I achieve that? Thank you very much

show sets is showing 0 objects … so you did truncate. in CE truncates are not durable. so coldstart may resurrect the records if they have not been overwritten by new records.

Thanks for your reply.

Honestly I thought that the truncate-namespace command would remove also the set-names. In this manner it looks like that I ran multiple truncate=namespace:test;setname=<name>; in one go. Is there any chance that I can remove also the setnames? Or do I need the Enterprise version for that?

Set/bin names are a tricky to purge: How to clear up set and bin names when it exceeds the maximum set limit.

In EE, using truncate followed by a cold-start will remove the set since EE supports durable-deletes. But because the records come back with the set in CE you have to use the method of wiping storage.

Thank you for your reply. I think that I am not fully ready to put this database in production. I do have a lot of issues in data-consistency and the features I need are available only in the EE version which I cannot purchase. I think I have to revert towards another database. Too bad because Aerospike seems the perfect fit.

Thanks once again for you time.

© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.