# Failing understanding Truncate-Namespace command

**URL:** <https://discuss.aerospike.com/t/failing-understanding-truncate-namespace-command/6829>\
**Category:** General Discussion\
**Created:** [November 15, 2019, 2:05am UTC](https://discuss.aerospike.com/t/failing-understanding-truncate-namespace-command/6829 "2019-11-15T02:05:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![spaghettifunk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@spaghettifunk](https://discuss.aerospike.com/u/spaghettifunk)\
**Post date:** [November 15, 2019, 2:05am UTC](https://discuss.aerospike.com/t/failing-understanding-truncate-namespace-command/6829/1 "2019-11-15T02:05:22Z")

</div>

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.

```auto
$: 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

```auto
# 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

---

<div class="post-metadata">

**Author:** ![pgupta](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/pgupta/32/2351_2.png) [@pgupta](https://discuss.aerospike.com/u/pgupta)\
**Post date:** [November 15, 2019, 8:51am UTC](https://discuss.aerospike.com/t/failing-understanding-truncate-namespace-command/6829/2 "2019-11-15T08:51:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![spaghettifunk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@spaghettifunk](https://discuss.aerospike.com/u/spaghettifunk)\
**Post date:** [November 15, 2019, 4:22pm UTC](https://discuss.aerospike.com/t/failing-understanding-truncate-namespace-command/6829/3 "2019-11-15T16:22:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![kporter](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/kporter/32/515_2.png) [@kporter](https://discuss.aerospike.com/u/kporter)\
**Post date:** [November 15, 2019, 5:37pm UTC](https://discuss.aerospike.com/t/failing-understanding-truncate-namespace-command/6829/4 "2019-11-15T17:37:56Z")

</div>

Set/bin names are a tricky to purge: [How to clear up set and bin names when it exceeds the maximum set limit](https://discuss.aerospike.com/t/how-to-clear-up-set-and-bin-names-when-it-exceeds-the-maximum-set-limit/3122).

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.

---

<div class="post-metadata">

**Author:** ![spaghettifunk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@spaghettifunk](https://discuss.aerospike.com/u/spaghettifunk)\
**Post date:** [November 15, 2019, 5:58pm UTC](https://discuss.aerospike.com/t/failing-understanding-truncate-namespace-command/6829/5 "2019-11-15T17:58:13Z")

</div>

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.
