Skip to content

Conversation

@hmmr
Copy link
Contributor

@hmmr hmmr commented Mar 15, 2025

This PR implements "Tictac runtime management and reporting" section of the TicTac AAE and NextGenRepl CLI commands proposal.

The riak_kv_console:titacaae_cmd/1 functions will be exposed as the following riak admin commands:

Tictac AAE runtime management and reporting

  riak admin tictacaae rebuild_schedule [-n NODE] [-p PARTITION] [RW RD]
  riak admin tictacaae storeheads [-n NODE] [-p PARTITION] [VALUE]
  riak admin tictacaae tokenbucket [-n NODE] [-p PARTITION] [VALUE]
  riak admin tictacaae rebuildtick|exchangetick|maxresults|rangeboost [-n NODE] [VAL]
  riak admin tictacaae rebuild-soon [-n NODE] [-p PARTITION] DELAY
  riak admin tictacaae rebuild-now [-n NODE] [-p PARTITION] DELAY
  riak admin tictacaae rebuildtreeworkers|rebuildstoreworkers|aaefoldworkers [-n NODE] POOLSIZE
  riak admin tictacaae treestatus [--format table|json] [--show STATES]

Notes:

  • Commands rebuildtick, exchangetick, maxresults, rangeboost are simple set/show commands, reading and setting the corresponding app env vars in the riak_kv app, on local node by default or on other node if specified with option -n.

  • rebuild-soon will schedule a tree rebuild, and rebuild-now will additionally send a poke to controller(s) associated with partitions or nodes as specified with options -n and -p.

  • Commands storeheads, tokenbucket, rebuild_schedule will extract or inject the actual relevant values from/to the state of the running AAE controller processes.

  • Commands rebuildtreeworkers, rebuildstoreworkers, aaefoldworkers will read/set the size of worker pools af1, af4 and be, correspondingly.

  • The treestatus command will collect various items from running AAE contollers and produce a report like this:

$ ./dev/dev1/riak/bin/riak admin tictacaae treestatus --show=all
                                        Partition ID      Status      Last Rebuild Date     Next Rebuild Date   Controller PID  Key Store Status
----------------------------------------------------  ----------  ---------------------  --------------------  ---------------  ----------------
   1004782375664995756265033322492444576013453623296     unbuilt                  never   2025-03-21T19:14:21       <0.2780.0>            native
                                                   0     unbuilt                  never   2025-03-23T04:59:09       <0.2296.0>            native
   1073290264914881830555831049026020342559825461248     unbuilt                  never   2025-03-16T14:05:43       <0.2763.0>            native
   ...

AAE fold operations

  riak tictacaae fold list-buckets NVAL
  riak tictacaae fold find-keys BUCKET KEY_RANGE MODIFIED_RANGE sibling_count=COUNT|object_size=BYTES
  riak tictacaae fold find-keys BUCKET KEY_RANGE MODIFIED_RANGE sibling_count=COUNT|object_size=BYTES
  riak tictacaae fold find|count-tombstones KEY_RANGE SEGMENTS MODIFIED_RANGE
  riak tictacaae fold reap-tombstones KEY_RANGE SEGMENTS MODIFIED_RANGE CHANGE_METHOD
  riak tictacaae fold object-stats BUCKET KEY_RANGE MODIFIED_RANGE
  riak tictacaae fold erase-keys BUCKET KEY_RANGE SEGMENTS MODIFIED_RANGE CHANGE_METHOD
  riak tictacaae fold repair-keys BUCKET KEY_RANGE MODIFIED_RANGE

These will call the corresponding aae_fold operation and dump results in JSON format in a file named "aaefold-%o-results-%t.json", where "%o" will be substituted with the operation being performed, and "%t", with the current datetime string, or to a file explicitly specified with option -o.

Depends on these PRs: OpenRiak/kv_index_tictactree#4, OpenRiak/riak_core#20 and OpenRiak/poolboy#1.

Required by OpenRiak/riak#13.

Integration tests in https://github.com/OpenRiak/riak_test/pull/38.

@hmmr hmmr changed the title console callbacks for TicTac AAE CLI commands WIP console callbacks for TicTac AAE CLI commands May 18, 2025
@hmmr
Copy link
Contributor Author

hmmr commented May 26, 2025

After converting it to use clique, this PR is great again and ready for review.

Note that OpenRiak/poolboy#1 and OpenRiak/kv_index_tictactree#4 as well as OpenRiak/riak_core#20 need to be dealt with first.

@hmmr hmmr changed the title WIP console callbacks for TicTac AAE CLI commands console callbacks for TicTac AAE CLI commands May 26, 2025
hmmr and others added 3 commits August 28, 2025 15:53
* Tictac runtime management and reporting:
  riak admin tictacaae rebuild_schedule [-n NODE] [-p PARTITION] [RW RD]
  riak admin tictacaae storeheads [-n NODE] [-p PARTITION] [VALUE]
  riak admin tictacaae tokenbucket [-n NODE] [-p PARTITION] [VALUE]
  riak admin tictacaae rebuildtick|exchangetick|maxresults|rangeboost [-n NODE] [VAL]
  riak admin tictacaae rebuild-soon [-n NODE] [-p PARTITION] DELAY
  riak admin tictacaae rebuild-now [-n NODE] [-p PARTITION] DELAY
  riak admin tictacaae rebuildtreeworkers|rebuildstoreworkers|aaefoldworkers [-n NODE] POOLSIZE
  riak admin tictacaae treestatus [--format table|json] [--show STATES]

* AAE fold operations, dumping results in JSON format:
  riak tictacaae fold list-buckets NVAL
  riak tictacaae fold find-keys BUCKET KEY_RANGE MODIFIED_RANGE sibling_count=COUNT|object_size=BYTES
  riak tictacaae fold find-keys BUCKET KEY_RANGE MODIFIED_RANGE sibling_count=COUNT|object_size=BYTES
  riak tictacaae fold find|count-tombstones KEY_RANGE SEGMENTS MODIFIED_RANGE
  riak tictacaae fold reap-tombstones KEY_RANGE SEGMENTS MODIFIED_RANGE CHANGE_METHOD
  riak tictacaae fold object-stats BUCKET KEY_RANGE MODIFIED_RANGE
  riak tictacaae fold erase-keys BUCKET KEY_RANGE SEGMENTS MODIFIED_RANGE CHANGE_METHOD
  riak tictacaae fold repair-keys BUCKET KEY_RANGE MODIFIED_RANGE

{deps, [
{riak_core, {git, "https://github.com/OpenRiak/riak_core.git", {branch, "openriak-3.4"}}},
{riak_core, {git, "https://github.com/TI-Tokyo/riak_core.git", {branch, "tiot/openriak-3.4/tictacaae-and-nextgenrepl-cli-commands"}}},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to revert

@hmmr hmmr force-pushed the tiot/openriak-3.4/tictacaae-and-nextgenrepl-cli-commands branch from 84f6aca to 45aa9b8 Compare September 24, 2025 15:07
@hmmr
Copy link
Contributor Author

hmmr commented Sep 24, 2025

Marking it WIP pending review of OpenRiak/poolboy#1 and OpenRiak/riak_core#20.

@hmmr hmmr changed the title console callbacks for TicTac AAE CLI commands WIP console callbacks for TicTac AAE CLI commands Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants