Truncate set and cold restart

  • Why do we need to cold-restart of the node followed by set truncate?
  • Cold restart is mandatory for every truncate?
  • What happens if we don’t cold restart but do fast restart (default, i guess)?

Where does it say you need a cold restart?

  • You don’t.
  • No.
  • Truncate is completely independent of any restarts.
1 Like

Your intent is ambiguous. If you are just planning to delete all the records in a set, then truncate will do that. In Community Edition (CE), truncate applies at runtime only. CE always coldstarts, no option to warm restart. If after truncating a set, you were to restart a CE node (i.e. coldstart), potentially all truncated records may come back. In EE, truncate is persistent - so whether you warm-restart EE (default) or specifically coldstart it, truncated records will not come back.

Now there the other ambiguity in your question. Are you trying to delete the set name also? In Aerospike, you can have max 1023 set names. Once you use that quota, you cannot use additional set names and you may be wanting to delete records in a set and then purge that set name. When doing that, in EE, there is a procedure that involves using truncate followed by coldstart. So, perhaps that is what you are referring to.

Finally, there is a third angle - in EE - lets say you issue a truncate by mistake and want to immediately reverse it. In that case, there is a truncate-undo command available which should be followed by a coldstart to retrieve back as many records as possible before they get overwritten on the storage medium by new incoming writes. But it has its gotchas - will work acceptably as long as you always used durable deletes in EE.

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