7
/home/khorkak> sudo riak-admin bucket-type
Usage: riak-admin bucket-type <command>

The follow commands can be used to manage bucket types for the cluster:

   list                           List all bucket types and their activation status
   status <type>                  Display the status and properties of a type
   activate <type>                Activate a type
   create <type> <json>           Create or modify a type before activation
   update <type> <json>           Update a type after activation
/home/khorkak>

Well I have a set of bucket types I created while trying some things out that I no longer want around - can I get rid of these without reinstalling Riak?

Khorkrak
  • 3,911
  • 2
  • 27
  • 37

1 Answers1

7

Unfortunately there is no documented way within Riak currently to delete unused bucket types.

If you don't mind deleting all of the data in Riak you can stop Riak, delete the contents of the data directory, and then restart Riak. (If you have more than one node you will need to to stop each node and delete the data directory on each before restarting the nodes back up.)

If you only delete the data within Bitcask or LevelDB data directories the bucket type metadata will still exist in the ring.

Craig
  • 1,001
  • 6
  • 11
  • 3
    Thanks I can reload my data easily enough presently so I'll give this a try. Would be annoying though if I had lots of data to deal with already - seems like something that should be handled better. – Khorkrak Dec 22 '14 at 00:36
  • 1
    While it would be nice to have the ability to delete bucket types it might be a non trivial piece of functionality to add to bucket types based on Riak's architecture. Before deleting a bucket type you would want to make sure that there are no buckets in the bucket type (and no keys within those buckets). Both List Buckets and List Keys operations requires traversing all the keys in a cluster which is very expensive and not recommended in production. – Craig Dec 22 '14 at 03:24
  • 3
    There is a reset function in the riak_core_bucket module that will replace the bucket type's details with a tombstone, but that is the closest to deleting that I see. A comment from the riak_core_metadata module: "%% NOTE: currently deletion is logical and no GC is performed." I would assume that the tombstoned bucket types would no longer be usable, but at least the name will be kept in the ring. – Joe Dec 22 '14 at 21:44
  • note: in OSX if you installed with homebrew the directory is `/usr/local/var/lib/riak` – jisaacstone Mar 17 '15 at 03:57