Is there a manual way to force a flush and a major (i.e. full) compaction of a table in YugaByte DB?

I could not find any documentation on this. We noticed a few cases where there were errors in the yb-tserver.INFO files of the form.

Stalling writes because we have 24 level-0 files

Hi @Edward_Ribbery,

This means that compactions are not able to keep up with the write load, or there might be a bug.

Can you describe your setup (machine types, number of nodes, etc) and your client application behavior? Additionally, the following questions:

  • Which version of YugaByte DB are you running?
  • Have you truncated any tables and then continued to write data to them?
1 Like

There’s a manual way to force a flush or compaction for a table using the yb-admin tool.

% yb-admin -master_addresses <ip1>:7100,<ip2>:7100,<ip3>:7100 compact_table <keyspace> <tablename>

% yb-admin -master_addresses <ip1>:7100,<ip2>:7100,<ip3>:7100 flush_table <keyspace> <tablename>

1 Like