diff options
author | Luke Chen <luke.chen@mongodb.com> | 2018-09-26 12:51:03 +1000 |
---|---|---|
committer | Luke Chen <luke.chen@mongodb.com> | 2018-09-26 12:58:22 +1000 |
commit | fecda01a45da991501f9eb0863f98b242421a00a (patch) | |
tree | e8c63048ac0cbd75ccce02e975dc23da20a361ba /src/third_party/wiredtiger/dist/log.py | |
parent | 180fa35de98c2433d3d6e2a268b52e5734de1a0b (diff) | |
download | mongo-fecda01a45da991501f9eb0863f98b242421a00a.tar.gz |
Import wiredtiger: f2959cdb9f863f26dd0c3e3067a1af6f0d6061b4 from branch mongodb-4.2
ref: 7db12ec1b5..f2959cdb9f
for: 4.1.4
WT-4149 Log recovery and salvage should handle removal or truncation of log files
WT-4314 Don't access unmapped pages when evicting a tree
WT-4323 Fix race between setting transaction read_timestamp and updating global pinned timestamp
WT-4330 Change the wt utility to not use stdout if the -f option to the dump or printlog commands is specified
WT-4333 WiredTiger cursor cache doesn't handle all possible locked handle states
Diffstat (limited to 'src/third_party/wiredtiger/dist/log.py')
-rw-r--r-- | src/third_party/wiredtiger/dist/log.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/third_party/wiredtiger/dist/log.py b/src/third_party/wiredtiger/dist/log.py index 2503edea49d..4669b6bcc73 100644 --- a/src/third_party/wiredtiger/dist/log.py +++ b/src/third_party/wiredtiger/dist/log.py @@ -98,10 +98,11 @@ def printf_line(f, optype, i, ishex): name += '-hex' ifend = nl_indent + '}' nl_indent += '\t' - ifbegin = 'if (LF_ISSET(WT_TXN_PRINTLOG_HEX)) {' + nl_indent + ifbegin = \ + 'if (FLD_ISSET(args->flags, WT_TXN_PRINTLOG_HEX)) {' + nl_indent if postcomma == '': precomma = ',\\n' - body = '%s%s(__wt_fprintf(session, WT_STDOUT(session),' % ( + body = '%s%s(__wt_fprintf(session, args->fs,' % ( printf_setup(f, ishex, nl_indent), 'WT_ERR' if has_escape(optype.fields) else 'WT_RET') + \ '%s "%s \\"%s\\": %s%s",%s));' % ( @@ -277,13 +278,13 @@ __wt_logop_%(name)s_unpack( tfile.write(''' int __wt_logop_%(name)s_print(WT_SESSION_IMPL *session, - const uint8_t **pp, const uint8_t *end, uint32_t flags) + const uint8_t **pp, const uint8_t *end, WT_TXN_PRINTLOG_ARGS *args) {%(arg_ret)s%(arg_decls)s -\t%(arg_unused)s%(arg_init)sWT_RET(__wt_logop_%(name)s_unpack( +\t%(arg_init)sWT_RET(__wt_logop_%(name)s_unpack( \t session, pp, end%(arg_addrs)s)); -\tWT_RET(__wt_fprintf(session, WT_STDOUT(session), +\tWT_RET(__wt_fprintf(session, args->fs, \t " \\"optype\\": \\"%(name)s\\",\\n")); %(print_args)s %(arg_fini)s @@ -295,8 +296,6 @@ __wt_logop_%(name)s_print(WT_SESSION_IMPL *session, (clocaltype(f), '' if clocaltype(f)[-1] == '*' else ' ', f[1]) for f in optype.fields)) + escape_decl(optype.fields) if optype.fields else ''), - 'arg_unused' : ('' if has_escape(optype.fields) - else 'WT_UNUSED(flags);\n\t'), 'arg_init' : ('escaped = NULL;\n\t' if has_escape(optype.fields) else ''), 'arg_fini' : ('\nerr:\t__wt_free(session, escaped);\n\treturn (ret);' if has_escape(optype.fields) else '\treturn (0);'), @@ -310,7 +309,7 @@ __wt_logop_%(name)s_print(WT_SESSION_IMPL *session, tfile.write(''' int __wt_txn_op_printlog(WT_SESSION_IMPL *session, - const uint8_t **pp, const uint8_t *end, uint32_t flags) + const uint8_t **pp, const uint8_t *end, WT_TXN_PRINTLOG_ARGS *args) { \tuint32_t optype, opsize; @@ -323,7 +322,7 @@ __wt_txn_op_printlog(WT_SESSION_IMPL *session, for optype in log_data.optypes: tfile.write(''' \tcase %(macro)s: -\t\tWT_RET(%(print_func)s(session, pp, end, flags)); +\t\tWT_RET(%(print_func)s(session, pp, end, args)); \t\tbreak; ''' % { 'macro' : optype.macro_name(), |