Replies: 4 comments 3 replies
-
Yikes! That's a lot of commands. One generic concern is the problems we've had with our existing CLI commands. It is a real struggle to test them effectively via The second generic concern is about commands that don't give an immediate response. For example, aae_folds again, they may take some time. What does the operator do during the wait? If they cancel and re-query - that won't cancel the original query, just double the wait for the next result. So how should the user feedback loop be managed for such commands? Concern 1 - Testing, Easing ImplementationBecause of the first problem, I had started to add helper functions to the riak_client module e.g. https://github.com/OpenRiak/riak_kv/blob/openriak-3.2/src/riak_client.erl#L1013-L1020. My thoughts at the time were in the long run to have a I stopped progressing the above when we had an issue with a remote_console session which was disconnected by a network timeout, and caused a CPU core to burn busy until the node was restarted. So probably not the right answer, but testing CLI commands remains a problem if you want to introduce more. Concern 2 - ResponsivenessOne idea I had there was that a user-prompted fold should log the results to a file when they complete, not ask for the user to hang-on and wait. So, we could have a results.log alongside console.log etc - and if you request a query you get given a result reference you can tail the results.log and grep for. A good example for this would be stats by bucket - so from remote_console one can have a function that will run (the safe version of) list buckets, and then request the stats for each bucket, and then return the stats by bucket. This on most production clusters can take along time - so it would be better if that was spawned to run in the background and print the results into results.log bucket by bucket as they are returned. |
Beta Was this translation helpful? Give feedback.
-
None of these things are presently configurable at runtime i.e. the configuration values are read and set at startup, and never checked after startup. Do you intend to change this, as in some cases that would be significant work? |
Beta Was this translation helpful? Give feedback.
-
CLI commands are essential for a lot of users, even at large multi-national companies. You would not believe the issues we have had with getting people to use I think start with the low-hanging fruit (those that require no code changes - just calling existing code) and come up with a testable way to implement these. On that note, I really like the idea of making the CLI calls essentially a dumb pass-through to I also very much like the idea of running queries as background tasks and logging to a file. If the response comes back before a timeout, then print to screen. If timeout then print message about checking the log. For ctrl-C use a signal handler in the script file to tell people that the query is still running and that they should check the log file for the response. |
Beta Was this translation helpful? Give feedback.
-
This reminded me about making this available via the CLI - OpenRiak/riak_kv#45 |
Beta Was this translation helpful? Give feedback.
-
Background
One issue we (TI Tokyo) are coming up against with users is the lack of easy runtime management and reporting on TicTac AAE and NextGenRepl. We've written some tools to report on TicTac AAE tree status and told people how to change runtime settings where we can, but it needs to be much easier. There used to be
rial-repl
for legacy replication and users expect something similar - especially on the reporting side.This won't provide per-peer object/second or bytes/second counts, which would be very useful to add as well but would require considerably more work. If those were available, they vould be added as extra properties in the "status" outputs without the need for more commands.
Proposal
We propose adding the CLI and HTTP API commands below be added.
Some of these are identical to existing
riak attach
commands. Some are combinations, or have JSON output instead of an Erlang tuple output. Some require new code to be written or added (such as the aae tree status report). Some require minor tweaks to existing code (looking at rebuild wait and delay specifically).We'd love for this to be available in the first OpenRiak KV release (3.2.3), but it might well be too late for that. OpenRiak KV 3.4.0 is probably the better target version. We'll start work on a PR for this, but if anyone has any feedback, changes, additions, issues, foreseeable issues, etc then they would be greatly appreciated.
Riak CLI
Tictac runtime management and reporting
riak tictacaae rebuildwait [<n-in-hours>] [<nodename>]
<n>
then returns runtime tictacaae_rebuildwait, optionally for specific node<n>
then sets runtime tictacaae_rebuildwait, optionally for specific noderiak tictacaae rebuilddelay [<n-in-minutes>] [<nodename>]
<n>
then returns runtime tictacaae_rebuilddelay, optionally for specific node<n>
then sets runtime tictacaae_rebuilddelay, optionally for specific noderiak tictacaae rebuildtick [<n-in-milliseconds>] [<nodename>]
<n>
then returns runtime tictacaae_rebuildtick, optionally for specific node<n>
then sets runtime tictacaae_rebuildtick, optionally for specific noderiak tictacaae exchangetick [<n-in-milliseconds>] [<nodename>]
<n>
then returns runtime tictacaae_exchangetick, optionally for specific node<n>
then sets runtime tictacaae_exchangetick, optionally for specific noderiak tictacaae maxresults [<n>] [<nodename>]
<n>
then returns runtime tictacaae_maxresults, optionally for specific node<n>
then sets runtime tictacaae_maxresults, optionally for specific noderiak tictacaae storeheads [enabled|disabled] [<nodename>]
enabled|disabled
then returns runtime tictacaae_storeheads, optionally for specific nodeenabled|disabled
then sets runtime tictacaae_storeheads, optionally for specific noderiak tictacaae tokenbucket [enabled|disabled] [<nodename>]
enabled|disabled
then returns runtime aae_tokenbucket, optionally for specific nodeenabled|disabled
then sets runtime aae_tokenbucket, optionally for specific noderiak tictacaae rebuildtreeworkers [<n>] [<nodename>]
<n>
then returns runtime af1 pool size, optionally for specific node<n>
then sets runtime af1 pool size, optionally for specific noderiak tictacaae rebuildstoreworkers [<n>] [<nodename>]
<n>
then returns runtime be pool size, optionally for specific node<n>
then sets runtime be pool size, optionally for specific noderiak tictacaae aaefoldworkers [<n>] [<nodename>]
<n>
then returns runtime af4 pool size, optionally for specific node<n>
then sets runtime af4 pool size, optionally for specific noderiak tictacaae rebuild-soon all|<nodename>|<partition-id>
riak tictacaae rebuild-next all|<nodename>|<partition-id>
riak tictacaae rebuild-now all|<nodename>|<partition-id>
riak tictacaae treestatus [<partition-id>|<nodename>] [by-last-rebuilt|by-next-rebuild|by-partition]
riak tictacaae treestatus-json [<partition-id>|<nodename>]
Admin tasks
riak tictacaae fold findkeys [bucket all|"bucketname"|{"typename","bucketname"}] [keyrange all|{"from", "to"}] [modified all|{"YYYY-MM-DD hh:mm:ss", "YYYY-MM-DD hh:mm:ss"}] [[siblingcount <n>]|[objectsize <n-in-bytes>]]
riak tictacaae fold findtombstones [bucket all|"bucketname"|{"typename","bucketname"}] [keyrange all|{"from", "to"}] [modified all|{"YYYY-MM-DD hh:mm:ss", "YYYY-MM-DD hh:mm:ss"}] [[siblingcount <n>]|[objectsize <n-in-bytes>]]
riak tictacaae fold listbuckets
riak tictacaae fold countkeys [bucket all|"bucketname"|{"typename","bucketname"}] [keyrange all|{"from", "to"}] [modified all|{"YYYY-MM-DD hh:mm:ss", "YYYY-MM-DD hh:mm:ss"}]
riak tictacaae fold counttombstones [bucket all|"bucketname"|{"typename","bucketname"}] [keyrange all|{"from", "to"}] [modified all|{"YYYY-MM-DD hh:mm:ss", "YYYY-MM-DD hh:mm:ss"}]
riak tictacaae fold objectstatistics [bucket all|"bucketname"|{"typename","bucketname"}] [keyrange all|{"from", "to"}] [modified all|{"YYYY-MM-DD hh:mm:ss", "YYYY-MM-DD hh:mm:ss"}]
riak tictacaae fold erasekeys [bucket all|"bucketname"|{"typename","bucketname"}] [keyrange all|{"from", "to"}] [modified all|{"YYYY-MM-DD hh:mm:ss", "YYYY-MM-DD hh:mm:ss"}]
riak tictacaae fold reaptombstones [bucket all|"bucketname"|{"typename","bucketname"}] [keyrange all|{"from", "to"}] [modified all|{"YYYY-MM-DD hh:mm:ss", "YYYY-MM-DD hh:mm:ss"}]
riak tictacaae fold repairkeys [bucket all|"bucketname"|{"typename","bucketname"}] [keyrange all|{"from", "to"}] [modified all|{"YYYY-MM-DD hh:mm:ss", "YYYY-MM-DD hh:mm:ss"}]
NextGenRepl runtime management and reporting
Generic
riak nextgenrepl status <nodename>
Fullsync
riak nextgenrepl fullsync <nodename> scope [disabled|all|bucket|type]
riak nextgenrepl fullsync <nodename> bucket-filter-name ["name"]
riak nextgenrepl fullsync <nodename> bucket-filter-type ["type"]
riak nextgenrepl fullsync <nodename> queue-name [<queuename>]
riak nextgenrepl fullsync <nodename> bidirectional-queue-name [<queuename>]
riak nextgenrepl fullsync <nodename> max-results [<n>]
riak nextgenrepl fullsync <nodename> range-boost [<n>]
riak nextgenrepl fullsync <nodename> cluster-slice [<n>]
riak nextgenrepl fullsync <nodename> read-nval [<n>]
riak nextgenrepl fullsync <nodename> write-nval [<n>]
riak nextgenrepl fullsync <nodename> peer [<ip-address>|<fqdn> <port> pb|http
riak nextgenrepl fullsync <nodename> schedule
riak nextgenrepl fullsync <nodename> schedule auto [n]
riak nextgenrepl fullsync <nodename> schedule all [n]
riak nextgenrepl fullsync <nodename> schedule last-day [n]
riak nextgenrepl fullsync <nodename> schedule last-hour [n]
riak nextgenrepl fullsync <nodename> schedule since-last [n]
riak nextgenrepl fullsync <nodename> schedule skip [n]
riak nextgenrepl fullsync <nodename> workers <n>
Realtime
riak nextgenrepl realtime <nodename> source enable
riak nextgenrepl realtime <nodename> source disable
riak nextgenrepl realtime <nodename> source queues
riak nextgenrepl realtime <nodename> source queue-status <name>
riak nextgenrepl realtime <nodename> source add-queue <name> [any|block-rtq|bucketname <name>|bucketprefix <prefix>|buckettype <type>]
riak nextgenrepl realtime <nodename> source enable-queue <name>
riak nextgenrepl realtime <nodename> source disable-queue <name>
riak nextgenrepl realtime <nodename> source remove-queue <name>
Sink
riak nextgenrepl realtime <nodename> sink enable
riak nextgenrepl realtime <nodename> sink disable
riak nextgenrepl realtime <nodename> sink queue [<name>]
riak nextgenrepl realtime <nodename> sink peers
riak nextgenrepl realtime <nodename> sink peer-status <ip-address>|<fqdn>
riak nextgenrepl realtime <nodename> sink add-peer <ip-address>|<fqdn> <port> http|pb [<queuename>]
riak nextgenrepl realtime <nodename> sink remove-peer <ip-address>|<fqdn>
riak nextgenrepl realtime <nodename> sink workers <n>
riak nextgenrepl realtime <nodename> sink workers-peer-limit <n>
HTTP API end points
Tictac runtime management and reporting
/tictacaae/status[/<partition-id>|/<nodename>]
riak tictacaae treestatus-json
/tictacaae/rebuild-soon[/all|/<nodename>|/<partition-id>]
riak tictacaae rebuild-soon
/tictacaae/rebuild-next[/all|/<nodename>|/<partition-id>]
riak tictacaae rebuild-next
/tictacaae/rebuild-now[/all|/<nodename>|/<partition-id>]
riak tictacaae rebuild-now
NextGenRepl runtime management and reporting
/nextgenrepl/status[/<nodename>]
riak nextgenrepl status
Beta Was this translation helpful? Give feedback.
All reactions