In order to clear space from the DB table utilization, please run below steps.
shell> df -h
shell> ls -lh /usr/local/strongauth/mariadb-<latest-version>/ibdata/strongkeylite/decryption_requests.*
shell> ls -lh /usr/local/strongauth/mariadb-<latest-version>/ibdata/strongkeylite/search_requests.*
shell> sudo service glassfishd stop
shell> cd /usr/local/strongauth/dbdumps
shell> mysqldump -u root -p -w "request_date>'2023-01-01 00:00:00'" --lock-all-tables --insert-ignore --no-create-info strongkeylite decryption_requests > dec_req_2023jan1.db
shell> mysqldump -u root -p -w "request_date>'2023-01-01 00:00:00'" --lock-all-tables --insert-ignore --no-create-info strongkeylite search_requests > search_req_2023jan1.db
NOTE: It's understandable that you would like to keep this data for future reference. But, the data in these two tables are for logging purposes only and the same details will be stored in server.log files as well. So, if you would have server.log files from the same time period, you would have two copies of same logs. |
shell> mysql -u skles -p strongkeyliteor
shell> mys
MariaDB [strongkeylite]> truncate decryption_requests;
MariaDB [strongkeylite]> truncate search_requests;
NOTE: This command took 0.235 sec to cleanup 10.2M rows and it cleared ~1.8G of disk-space from 10.2M deleted records in our test environment. |
MariaDB> exit
shell> ls -lh /usr/local/strongauth/mariadb-10.2.30/ibdata/strongkeylite/decryption_requests.*
shell> ls -lh /usr/local/strongauth/mariadb-10.2.30/ibdata/strongkeylite/search_requests.*
shell> df -h
shell> sudo service glassfishd start
NOTE: For deletion_requests table, you may follow the same steps. But, before cleaning this table, make sure there is no replication backlog (run repl alias command on all nodes and if there is no output, it would mean all the data has been replicated). Also, you would have to make sure that new deletion requests are not being processed by any of the node in the cluster while performing these steps. You may schedule some maintenance time to clean up deletion_requests table, when there will not be any new deletion requests coming from the client application. |