Using > TicTac AAE Fold:
Find Tombstones

Returns tuples of bucket name, keyname, and object size of Riak tombstone objects that meet the filter parameters.

See the TicTac AAE aae_folds documentation for configuration, tuning and troubleshootings help.

The find_tombs function

Run this using riak attach.

riak_client:aae_fold({
    find_tombs,
    bucket_filter,
    key_range_filter,
    segment_filter
    modified_filter
    }, Client).

Please see the list of available filters below.

For example, the following snippet will find all tombstones with the filters:

  • in the bucket “dogs” of bucket type “animals”
  • whose keys are between “A” and “N”
  • which were modified in January 2022
riak_client:aae_fold({
    find_tombs,
    {<<"animals">>,<<"dogs">>},
    {<<"A">>,<<"N">>},
    all,
    {date,1640995200,1643673600}
    }, Client).

How to get the value for Client is detailed in The Riak Client.

The response

The response will be an array of {bucket_name,key_name,object_size} tuples that will look something like this:

{ok,[{{<<"animals">>,<<"dogs">>},<<"Barkie">>,550000},
    {{<<"animals">>,<<"dogs">>},<<"Lord Snuffles III">>,820000}]}

This indicates that 2 tombstones were found meeting the filter parameters. For each tombstone object found, an additional {bucket_name,key_name,object_size} tuple will be added to the array.

Field Example Description
bucket_name <<"cars">> or {<<"animals">>,<<"dogs">>} The bucket name as an Erlang binary. In the case of a bucket with a bucket type, a tuple of bucket type and bucket name.
key_name <<"Barkie">> The key name as an Erlang binary.
object_size 550000 The size in bytes of the tombstone object.

Available filters

These filters are detailed in the Filters documentation and can be used to limit the keys considered for reaping or counting.

These filters will reduce the keys to be searched:

These filters will reduce the number of keys considered for reaping or counting: