summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/tools
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2019-05-07 16:35:05 +1000
committerLuke Chen <luke.chen@mongodb.com>2019-05-07 16:35:05 +1000
commit400e0500147836ba11ab611bdac2675d65cb7b48 (patch)
treeb87b043ef767d5ca50d43ec6a7ad09f6f4d27073 /src/third_party/wiredtiger/tools
parent8ad1effc48ac5193c5f57630d1fbce8bda0cfdaf (diff)
downloadmongo-400e0500147836ba11ab611bdac2675d65cb7b48.tar.gz
Import wiredtiger: d9ec69f9111b036ee0b19b47368e15bff8d4818d from branch mongodb-4.2
ref: 617a81369c..d9ec69f911 for: 4.1.11 WT-4278 Clarify in docs that schema operations are not transactional WT-4309 Increase the maximum expected LAS test reads WT-4352 Resolve birthmarks during eviction in more cases WT-4582 Respect prepared updates in lookaside WT-4642 Store transaction IDs durably WT-4670 Remove support for WiredTiger LevelDB APIs WT-4688 Fix test and docs for correct log cursor usage WT-4690 Make sure eviction does not split during checkpoints WT-4697 Python3: change workgen to work with Python3 WT-4706 Add a statistic to track the lookaside table size WT-4723 Restructure the reconciliation code WT-4725 Python3: change miscellaneous scripts to run under Python3 WT-4726 Python3: set up pull request tester to run with Python3 WT-4728 Remove the stop timestamp from the WT_UPDATE structure WT-4738 Tighten rules around use of timestamps WT-4745 Update upgrading documentation before 3.2.0 WiredTiger release WT-4746 Document that transactions without timestamps clear history WT-4749 Fix error message formatting (possible SEGV) for prepare_transaction WT-4751 Change __wt_timestamp_to_string() to return a pointer to simplify verbose WT-4752 WiredTiger autoconfig check for the compiler incorrectly quoted WT-4753 Strip the timing_stress configuration options from the base configuration WT-4754 Change the checkpoint code to not require a list order WT-4755 Switch to a better timestamp and transaction ID ordering convention WT-4756 Fix comment in python integer encoder WT-4759 Save a copy when an old overflow value is discarded WT-4764 Avoid choosing a transaction frequency of 0 in test/format
Diffstat (limited to 'src/third_party/wiredtiger/tools')
-rwxr-xr-x[-rw-r--r--]src/third_party/wiredtiger/tools/wt_ckpt_decode.py30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/third_party/wiredtiger/tools/wt_ckpt_decode.py b/src/third_party/wiredtiger/tools/wt_ckpt_decode.py
index 8d448318451..e611766e3c7 100644..100755
--- a/src/third_party/wiredtiger/tools/wt_ckpt_decode.py
+++ b/src/third_party/wiredtiger/tools/wt_ckpt_decode.py
@@ -27,18 +27,23 @@
# OTHER DEALINGS IN THE SOFTWARE.
# Decode a checkpoint 'addr'
+#
+# This script uses WiredTiger's integer unpacking library. To load the
+# WiredTiger library built in a development tree, you may have to set
+# LD_LIBRARY_PATH or the equivalent for your system. For example:
+# $ export LD_LIBRARY_PATH=`pwd`/../build_posix/.libs
import os, sys, getopt
def usage():
- print 'Usage:\n\
+ print('Usage:\n\
$ python .../tools/wt_ckpt_decode.py [ -a allocsize ] addr...\n\
\n\
addr is a hex string\n\
-'
+')
def err_usage(msg):
- print 'wt_ckpt_decode.py: ERROR: ' + msg
+ print('wt_ckpt_decode.py: ERROR: ' + msg)
usage()
sys.exit(False)
@@ -48,14 +53,15 @@ while not os.path.isdir(wt_disttop + '/build_posix'):
if wt_disttop == '/':
err_usage('current dir not in wiredtiger development directory')
wt_disttop = os.path.dirname(wt_disttop)
-sys.path.insert(1, os.path.join(wt_disttop, 'lang', 'python', 'wiredtiger'))
+ sys.path.insert(1, os.path.join(wt_disttop, 'build_posix', 'lang',
+ 'python'))
-from packing import pack, unpack
+from wiredtiger.packing import unpack
def show_one(label, value):
l = 16 - len(label)
l = l if l > 1 else 1
- print ' {0}{1}{2:10d} (0x{2:x})'.format(label, (' ' * l), value, value)
+ print(' {0}{1}{2:10d} (0x{2:x})'.format(label, (' ' * l), value, value))
def show_triple(triple, name, allocsize):
off = triple[0]
@@ -67,18 +73,18 @@ def show_triple(triple, name, allocsize):
show_one(name + ' offset', (off + 1) * allocsize)
show_one(name + ' size', (size) * allocsize)
show_one(name + ' cksum', csum)
- print ''
+ print('')
def decode_arg(arg, allocsize):
- addr = arg.decode("hex")
- version = ord(addr[0])
- print arg + ': '
+ addr = bytearray.fromhex(arg)
+ version = addr[0]
+ print(arg + ': ')
if version != 1:
- print '**** ERROR: unknown version ' + str(version)
+ print('**** ERROR: unknown version ' + str(version))
addr = addr[1:]
result = unpack('iiiiiiiiiiiiii',addr)
if len(result) != 14:
- print '**** ERROR: result len unexpected: ' + str(len(result))
+ print('**** ERROR: result len unexpected: ' + str(len(result)))
show_triple(result[0:3], 'root', allocsize)
show_triple(result[3:6], 'alloc', allocsize)
show_triple(result[6:9], 'avail', allocsize)