Search code examples
mysqldata-recoverydisaster-recoverytokudb

Restore/Recover/Recreate tokudb table (from missing status file)


I have a TokuDB table that for some reason has a missing ***_status.tokudb file.

I am not yet sure, whether the file is missing due to a TokuDB crash or not.

Question is:

  • Is there a way to recover or recreate the status file from the main and key files (which I can see are present from tokudb_file map.)??
  • How can I debug what caused the tokuDB status file to get deleted ?

Is this really frequent or a known bug ? https://github.com/percona/tokudb-engine/wiki/Broken-tables-caused-by-non-transactional-table-operations#unexplained-inconsistency-problems-with-tokudb


Solution

  • So, I was able to recover my files from the main files.

    I still don't know what deleted the status files though.

    The toku-ft repository has an internal debugging tool called tokuftdump.

    After it parses the tree, it dumps bytestreams on the leaf entries that are unpacked. Some quick hex editing on the converted hexstreams reveals the structure, and then you can modify the utility to dump the exact values post parsing as revealed by the structure.

    Since toku has message buffers on nodes, you also may need some additional message processing. In my case this was simple since I only had inserts...

    Update: More details can be found here.

    http://kshitij.learnercafe.com/TokuDB-Recovery-From-Files