basho/riak_kv — pull request #827 by jrwest (2014-02-05 02:54:00+00:00)
Title: warn about inability to downgrade after activating bucket type

As discussed.

This implementation is less ideal than potentially writing a flag, serialized through the claimant like other bucket type operations, and checking that. A potential degenerate case is a user creating thousands of bucket types without activating any of them. However, after creating 50k+ bucket types without activation the time to create or activate a type in scientific"" tests on my machine didn't take noticeably longer than on a node with only a few types.

Example:

User first has no types:
```
$ dev/dev1/bin/riak-admin bucket-type list
default (active)
```

User first creates a type:
```
$ dev/dev1/bin/riak-admin bucket-type create type1 '{"props": {}}'
type1 created

WARNING: After activating type1, nodes in this cluster
can no longer be downgraded to a version of Riak prior to 2.0
```

User creates another type, but no types have been activated, so warning still emitted. Same
when `create` is called again to change the properties on the type.
```
$ dev/dev1/bin/riak-admin bucket-type create type2 '{"props": {}}'
type2 created

WARNING: After activating type2, nodes in this cluster
can no longer be downgraded to a version of Riak prior to 2.0
$ dev/dev1/bin/riak-admin bucket-type create type2 '{"props": {"allow_mult": false}}'
type2 created

WARNING: After activating type2, nodes in this cluster
can no longer be downgraded to a version of Riak prior to 2.0
```

User activates a type, a final warning is emitted:

```
$ dev/dev1/bin/riak-admin bucket-type activate type1
type1 has been activated

WARNING: Nodes in this cluster can no longer be
downgraded to a version of Riak prior to 2.0
```

Future operations have no warning:

```
$ dev/dev1/bin/riak-admin bucket-type create type2 '{"props": {"allow_mult": true}}'
type2 created
$ dev/dev1/bin/riak-admin bucket-type activate type2
type2 has been activated
$ dev/dev1/bin/riak-admin bucket-type create type3 '{"props": {"datatype": "set"}}'
type3 created
$ dev/dev1/bin/riak-admin bucket-type activate type3
type3 has been activated
$ dev/dev1/bin/riak-admin bucket-type list
default (active)
type3 (active)
type1 (active)
type2 (active)
```