This topic describes how to use dumpsst. dumpsst displays the content in block_file. You can use it to trace online issues and locate data issues based on macroblocks.
You can run the following command to query the help information of dumpsst.
$ ./ob_admin dumpsst --help
succ to open, filename=ob_admin.log, fd=3, wf_fd=2
old log_file need close, old = ob_admin.log new = ob_admin.log
succ to open, filename=ob_admin.log, fd=3, wf_fd=2
succ to open, filename=ob_admin_rs.log, fd=4, wf_fd=2
Usage: dumpsst command [command args] [options]
commands:
-d,--dump dump, arg: [macro_block]
-h,--help display this message.
options:
-f,--data-file-name data file path or the ofs address
-a,--macro-id macro block id
-i,--micro-id micro block id, -1 means all micro blocks
-n,--macro-size macro block size, in bytes
-q,--quiet log level: ERROR
-x,--hex-print print obj value in hex mode
-k,--master_key master key, hex str
-m,--master_key_id master key id
-t,--tablet_id tablet id
-s,--logical_version macro block logical version
samples:
dump all rows in macro:
ob_admin -d macro_block -f block_file_path -a macro_id
dump specified block in the shared block:
ob_admin -d macro_block -f block_file_path -a macro_id -t tablet_id -s logical_version
The following example shows a common usage of dumpsst.
macro_block
You can run the following commands to show the content of an SSTable block, including the macroblock common header, macro header, microblock index, microblock header, and each data record. These commands are most frequently used. The command syntax is as follows:
# Local mode:
./ob_admin -d macro_block -f block_file_path -a macro_id
./ob_admin -d macro_block -f block_file_path -a macro_id -t tablet_id -s logical_version
where
-dspecifies the type of the dump macroblock. At present, only themacro_blocktype is supported.-fspecifies the absolute path of the folder where the data file is located.-aspecifies the subscript of the macroblock.-tspecifies the subscript of the shard.-sspecifies the logical version number of the macroblock.