ALL COVERED TOPICS

NoSQL Benchmarks NoSQL use cases NoSQL Videos NoSQL Hybrid Solutions NoSQL Presentations Big Data Hadoop MapReduce Pig Hive Flume Oozie Sqoop HDFS ZooKeeper Cascading Cascalog BigTable Cassandra HBase Hypertable Couchbase CouchDB MongoDB OrientDB RavenDB Jackrabbit Terrastore Amazon DynamoDB Redis Riak Project Voldemort Tokyo Cabinet Kyoto Cabinet memcached Amazon SimpleDB Datomic MemcacheDB M/DB GT.M Amazon Dynamo Dynomite Mnesia Yahoo! PNUTS/Sherpa Neo4j InfoGrid Sones GraphDB InfiniteGraph AllegroGraph MarkLogic Clustrix CouchDB Case Studies MongoDB Case Studies NoSQL at Adobe NoSQL at Facebook NoSQL at Twitter

NAVIGATE MAIN CATEGORIES

Close

Tokyo Cabinet Database Recovery

Even if you don’t hit this ugly issue, non-transactional Tokyo Cabinet is not crash safe. Toru Maesaka took the time to document the recovery process:

  1. confirming that the database is broken by using the command line tools:

    Look at the “additional flags” line on the output of tchmgr inform or tcbmgr inform depending on your database type. If it says, “fetal” then your file is really broken. If it says “open”, it means that your application died or exited without closing the database. A file in the “open” state is still usable but your most recent records are most likely unavailable.

    Note: Even if I wish you’ll never have to see it, I really hope that the term is “fatal” (instead of “fetal”).

  2. use Tokyo Cabinet API

    1. open the database file without the lock option
    2. run tchdboptimize() or tcbdboptimize()

    […] If you’re lucky, the above would repair the database that is associated with TC’s database object.

    Note: the last sentence doesn’t sound too encouraging.

  3. use Tokyo Cabinet command line tool (alternative solution)

    TC provides a utility program called tchmgr (for a hash database) and tcbmgr (for a b+tree database) which allows you to run optimize on a database file.

Having in mind that the main developer of Tokyo Cabinet is already working on the Tokyo Cabinet successor, I really hope for two things:

  1. somebody will translate the Tokyo Cabinet documentation in English
  2. the Tokyo Cabinet successor will have both better tools and better documentation.

via: http://torum.net/2010/01/how-to-recover-a-tokyo-cabinet-database-file/