scylla-gdb: Fix scylla_compaction_tasks

Make it account for all the changes done in the compaction manager
recently. 5.0 is not affected. So does not merit a backport.

(gdb) scylla compaction-tasks
        1 type=sstables::compaction_type::Reshard, state=compaction_manager::task::state::active, "keyspace1"."standard1"
Total: 1 instances of compaction_manager::task

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
Message-Id: <20220621225600.20359-1-raphaelsc@scylladb.com>
This commit is contained in:
Raphael S. Carvalho' via ScyllaDB development
2022-06-21 19:56:00 -03:00
committed by Nadav Har'El
parent 026f58f2a4
commit 32600f60f3

View File

@@ -4488,13 +4488,23 @@ class scylla_compaction_tasks(gdb.Command):
task_list = list(std_list(cm['_tasks']))
for task in task_list:
task = seastar_lw_shared_ptr(task).get().dereference()
try:
schema = schema_ptr(task['compacting_table'].dereference()['_schema'])
task = seastar_shared_ptr(task).get().dereference()
except:
schema = schema_ptr(task['compacting_cf'].dereference()['_schema'])
task = seastar_lw_shared_ptr(task).get().dereference() # Scylla 5.0 compatibility
key = 'type={}, running={:5}, {}'.format(task['type'], str(task['compaction_running']), schema.table_name())
try:
schema = schema_ptr(task['_compacting_table'].dereference()['_schema'])
except:
try:
schema = schema_ptr(task['compacting_table'].dereference()['_schema']) # Scylla 5.0 compatibility
except:
schema = schema_ptr(task['compacting_cf'].dereference()['_schema']) # Scylla 4.6 compatibility
try:
key = 'type={}, state={:5}, {}'.format(task['_type'], str(task['_state']), schema.table_name())
except:
key = 'type={}, running={:5}, {}'.format(task['type'], str(task['compaction_running']), schema.table_name()) # Scylla 5.0 compatibility
task_hist.add(key)
task_hist.print_to_console()