]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
WritePrepared Txn: add write_committed option to dump_wal
authorMaysam Yabandeh <myabandeh@fb.com>
Sun, 8 Apr 2018 04:46:53 +0000 (21:46 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sun, 8 Apr 2018 04:56:42 +0000 (21:56 -0700)
commiteb5a295440837c671a619675dde444a446259ee6
tree7f9483c2a55ed3f364c731dc9f586f4fbfd33728
parentca87aef82ddcdb1eb808a036c3632974834fbf1a
WritePrepared Txn: add write_committed option to dump_wal

Summary:
Currently dump_wal cannot print the prepared records from the WAL that is generated by WRITE_PREPARED write policy since the default reaction of the handler is to return NotSupported if markers of WRITE_PREPARED are encountered. This patch enables the admin to pass --write_committed=false option, which will be accordingly passed to the handler. Note that DBFileDumperCommand and DBDumperCommand are still not updated by this patch but firstly they are not urgent and secondly we need to revise this approach later when we also add WRITE_UNPREPARED markers so I leave it for future work.

Tested by running it on a WAL generated by WRITE_PREPARED:
$ ./ldb dump_wal --walfile=/dev/shm/dbbench/000003.log  | grep BEGIN_PREARE | head -1
1,2,70,0,BEGIN_PREARE
$ ./ldb dump_wal --walfile=/dev/shm/dbbench/000003.log --write_committed=false | grep BEGIN_PREARE | head -1
1,2,70,0,BEGIN_PREARE PUT(0) : 0x30303031313330313938 PUT(0) : 0x30303032353732313935 END_PREPARE(0x74786E31313535383434323738303738363938313335312D30)
Closes https://github.com/facebook/rocksdb/pull/3682

Differential Revision: D7522090

Pulled By: maysamyabandeh

fbshipit-source-id: a0332207261c61e18b2f9dfbe9feecd9a1339aca
include/rocksdb/utilities/ldb_cmd.h
tools/ldb_cmd.cc
tools/ldb_cmd_impl.h