From 4d19d24ce330bc0cea252cfe8141e18a2045ab31 Mon Sep 17 00:00:00 2001 From: Don Anderson Date: Wed, 1 Jun 2016 16:37:35 -0400 Subject: [PATCH 1/8] WT-2677 Fix JSON output so only printable ASCII is produced. (#2764) The root cause is a sign extension error that shows up on systems that have a signed 'char'. --- src/cursor/cur_json.c | 2 +- src/include/extern.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cursor/cur_json.c b/src/cursor/cur_json.c index 133b7b9ac9b..39a5666b8c7 100644 --- a/src/cursor/cur_json.c +++ b/src/cursor/cur_json.c @@ -314,7 +314,7 @@ __wt_json_close(WT_SESSION_IMPL *session, WT_CURSOR *cursor) * Can be called with null buf for sizing. */ size_t -__wt_json_unpack_char(char ch, u_char *buf, size_t bufsz, bool force_unicode) +__wt_json_unpack_char(u_char ch, u_char *buf, size_t bufsz, bool force_unicode) { char abbrev; diff --git a/src/include/extern.h b/src/include/extern.h index 4ca5c8461a0..34751bfde6c 100644 --- a/src/include/extern.h +++ b/src/include/extern.h @@ -291,7 +291,7 @@ extern int __wt_curjoin_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSO extern int __wt_curjoin_join(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin, WT_INDEX *idx, WT_CURSOR *ref_cursor, uint8_t flags, uint8_t range, uint64_t count, uint32_t bloom_bit_count, uint32_t bloom_hash_count); extern int __wt_json_alloc_unpack(WT_SESSION_IMPL *session, const void *buffer, size_t size, const char *fmt, WT_CURSOR_JSON *json, bool iskey, va_list ap); extern void __wt_json_close(WT_SESSION_IMPL *session, WT_CURSOR *cursor); -extern size_t __wt_json_unpack_char(char ch, u_char *buf, size_t bufsz, bool force_unicode); +extern size_t __wt_json_unpack_char(u_char ch, u_char *buf, size_t bufsz, bool force_unicode); extern int __wt_json_column_init(WT_CURSOR *cursor, const char *keyformat, const WT_CONFIG_ITEM *idxconf, const WT_CONFIG_ITEM *colconf); extern int __wt_json_token(WT_SESSION *wt_session, const char *src, int *toktype, const char **tokstart, size_t *toklen); extern const char *__wt_json_tokname(int toktype); From 16ecfdbfdb40cef8401d0e1b074c85a599e3c51e Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Wed, 1 Jun 2016 17:24:18 -0400 Subject: [PATCH 2/8] Revert "WT-2677 Fix JSON output so only printable ASCII is produced. (#2764)" This reverts commit 4d19d24ce330bc0cea252cfe8141e18a2045ab31. --- src/cursor/cur_json.c | 2 +- src/include/extern.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cursor/cur_json.c b/src/cursor/cur_json.c index 39a5666b8c7..133b7b9ac9b 100644 --- a/src/cursor/cur_json.c +++ b/src/cursor/cur_json.c @@ -314,7 +314,7 @@ __wt_json_close(WT_SESSION_IMPL *session, WT_CURSOR *cursor) * Can be called with null buf for sizing. */ size_t -__wt_json_unpack_char(u_char ch, u_char *buf, size_t bufsz, bool force_unicode) +__wt_json_unpack_char(char ch, u_char *buf, size_t bufsz, bool force_unicode) { char abbrev; diff --git a/src/include/extern.h b/src/include/extern.h index 34751bfde6c..4ca5c8461a0 100644 --- a/src/include/extern.h +++ b/src/include/extern.h @@ -291,7 +291,7 @@ extern int __wt_curjoin_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSO extern int __wt_curjoin_join(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin, WT_INDEX *idx, WT_CURSOR *ref_cursor, uint8_t flags, uint8_t range, uint64_t count, uint32_t bloom_bit_count, uint32_t bloom_hash_count); extern int __wt_json_alloc_unpack(WT_SESSION_IMPL *session, const void *buffer, size_t size, const char *fmt, WT_CURSOR_JSON *json, bool iskey, va_list ap); extern void __wt_json_close(WT_SESSION_IMPL *session, WT_CURSOR *cursor); -extern size_t __wt_json_unpack_char(u_char ch, u_char *buf, size_t bufsz, bool force_unicode); +extern size_t __wt_json_unpack_char(char ch, u_char *buf, size_t bufsz, bool force_unicode); extern int __wt_json_column_init(WT_CURSOR *cursor, const char *keyformat, const WT_CONFIG_ITEM *idxconf, const WT_CONFIG_ITEM *colconf); extern int __wt_json_token(WT_SESSION *wt_session, const char *src, int *toktype, const char **tokstart, size_t *toklen); extern const char *__wt_json_tokname(int toktype); From ced588aecd604ab56670b8cdf66b8105e58f4fe3 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Wed, 1 Jun 2016 20:02:33 -0400 Subject: [PATCH 3/8] WT-2672 handle system calls that don't set errno (#2765) Define system call success as a 0 return, and split error handling into two parts: if the call returns -1, use errno, otherwise expect the failing return to be an error value. Replace calls to remove with unlink, so we know errno will be set. Do the best we can with rename, there's no easy workaround. POSIX requires posix_madvise return an errno value, but some OS versions return a -1/errno pair instead (at least FreeBSD and OS X). I don't care about retrying posix_madvise calls on failure, but since WT_SYSCALL_RETRY includes the necessary error handling magic, wrap the posix_madvise calls in WT_SYSCALL_RETRY. --- dist/s_string.ok | 1 + src/include/os.h | 27 +++++++++++++++++++-------- src/os_posix/os_dir.c | 2 +- src/os_posix/os_fs.c | 30 ++++++++++++++++++++++-------- src/os_posix/os_map.c | 13 +++++++++---- src/os_win/os_fs.c | 5 ----- 6 files changed, 52 insertions(+), 26 deletions(-) diff --git a/dist/s_string.ok b/dist/s_string.ok index 2cceccc538e..d45cace728a 100644 --- a/dist/s_string.ok +++ b/dist/s_string.ok @@ -442,6 +442,7 @@ bzDecompressInit bzalloc bzfree bzip +call's calloc cas catfmt diff --git a/src/include/os.h b/src/include/os.h index 1e08683bc83..dd9b96f73a8 100644 --- a/src/include/os.h +++ b/src/include/os.h @@ -9,15 +9,26 @@ #define WT_SYSCALL_RETRY(call, ret) do { \ int __retry; \ for (__retry = 0; __retry < 10; ++__retry) { \ - if ((call) == 0) { \ - (ret) = 0; \ - break; \ - } \ - switch ((ret) = __wt_errno()) { \ - case 0: \ - /* The call failed but didn't set errno. */ \ - (ret) = WT_ERROR; \ + /* \ + * A call returning 0 indicates success; any call where \ + * 0 is not the only successful return must provide an \ + * expression evaluating to 0 in all successful cases. \ + */ \ + if (((ret) = (call)) == 0) \ break; \ + /* \ + * The call's error was either returned by the call or \ + * is in errno, and there are cases where it depends on \ + * the software release as to which it is (for example, \ + * posix_fadvise on FreeBSD and OS X). Failing calls \ + * must either return a non-zero error value, or -1 if \ + * the error value is in errno. (The WiredTiger errno \ + * function returns WT_ERROR if errno is 0, which isn't \ + * ideal but won't discard the failure.) \ + */ \ + if ((ret) == -1) \ + (ret) = __wt_errno(); \ + switch (ret) { \ case EAGAIN: \ case EBUSY: \ case EINTR: \ diff --git a/src/os_posix/os_dir.c b/src/os_posix/os_dir.c index a23051e5b93..ea0ca11fa54 100644 --- a/src/os_posix/os_dir.c +++ b/src/os_posix/os_dir.c @@ -38,7 +38,7 @@ __wt_posix_directory_list(WT_FILE_SYSTEM *file_system, dirallocsz = 0; entries = NULL; - WT_SYSCALL_RETRY(((dirp = opendir(directory)) == NULL ? 1 : 0), ret); + WT_SYSCALL_RETRY(((dirp = opendir(directory)) == NULL ? -1 : 0), ret); if (ret != 0) WT_RET_MSG(session, ret, "%s: directory-list: opendir", directory); diff --git a/src/os_posix/os_fs.c b/src/os_posix/os_fs.c index c05f75f2bd5..1cfa8fd2d2d 100644 --- a/src/os_posix/os_fs.c +++ b/src/os_posix/os_fs.c @@ -53,7 +53,7 @@ __posix_sync( * "This is currently implemented on HFS, MS-DOS (FAT), and Universal * Disk Format (UDF) file systems." */ - WT_SYSCALL_RETRY(fcntl(fd, F_FULLFSYNC, 0), ret); + WT_SYSCALL_RETRY(fcntl(fd, F_FULLFSYNC, 0) == -1 ? -1 : 0, ret); if (ret == 0) return (0); /* @@ -92,7 +92,7 @@ __posix_directory_sync( session = (WT_SESSION_IMPL *)wt_session; WT_SYSCALL_RETRY(( - (fd = open(path, O_RDONLY, 0444)) == -1 ? 1 : 0), ret); + (fd = open(path, O_RDONLY, 0444)) == -1 ? -1 : 0), ret); if (ret != 0) WT_RET_MSG(session, ret, "%s: directory-sync: open", path); @@ -151,10 +151,17 @@ __posix_fs_remove( session = (WT_SESSION_IMPL *)wt_session; - WT_SYSCALL_RETRY(remove(name), ret); + /* + * ISO C doesn't require remove return -1 on failure or set errno (note + * POSIX 1003.1 extends C with those requirements). Regardless, use the + * unlink system call, instead of remove, to simplify error handling; + * where we're not doing any special checking for standards compliance, + * using unlink may be marginally safer. + */ + WT_SYSCALL_RETRY(unlink(name), ret); if (ret == 0) return (0); - WT_RET_MSG(session, ret, "%s: file-remove: remove", name); + WT_RET_MSG(session, ret, "%s: file-remove: unlink", name); } /* @@ -172,7 +179,14 @@ __posix_fs_rename(WT_FILE_SYSTEM *file_system, session = (WT_SESSION_IMPL *)wt_session; - WT_SYSCALL_RETRY(rename(from, to), ret); + /* + * ISO C doesn't require rename return -1 on failure or set errno (note + * POSIX 1003.1 extends C with those requirements). Be cautious, force + * any non-zero return to -1 so we'll check errno. We can still end up + * with the wrong errno (if errno is garbage), or the generic WT_ERROR + * return (if errno is 0), but we've done the best we can. + */ + WT_SYSCALL_RETRY(rename(from, to) != 0 ? -1 : 0, ret); if (ret == 0) return (0); WT_RET_MSG(session, ret, "%s to %s: file-rename: rename", from, to); @@ -295,7 +309,7 @@ __posix_file_lock( fl.l_type = lock ? F_WRLCK : F_UNLCK; fl.l_whence = SEEK_SET; - WT_SYSCALL_RETRY(fcntl(pfh->fd, F_SETLK, &fl), ret); + WT_SYSCALL_RETRY(fcntl(pfh->fd, F_SETLK, &fl) == -1 ? -1 : 0, ret); if (ret == 0) return (0); WT_RET_MSG(session, ret, "%s: handle-lock: fcntl", file_handle->name); @@ -533,7 +547,7 @@ __posix_open_file(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, f |= O_CLOEXEC; #endif WT_SYSCALL_RETRY(( - (pfh->fd = open(name, f, 0444)) == -1 ? 1 : 0), ret); + (pfh->fd = open(name, f, 0444)) == -1 ? -1 : 0), ret); if (ret != 0) WT_ERR_MSG(session, ret, "%s: handle-open: open", name); WT_ERR(__posix_open_file_cloexec(session, pfh->fd, name)); @@ -587,7 +601,7 @@ __posix_open_file(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, #endif } - WT_SYSCALL_RETRY(((pfh->fd = open(name, f, mode)) == -1 ? 1 : 0), ret); + WT_SYSCALL_RETRY(((pfh->fd = open(name, f, mode)) == -1 ? -1 : 0), ret); if (ret != 0) WT_ERR_MSG(session, ret, pfh->direct_io ? diff --git a/src/os_posix/os_map.c b/src/os_posix/os_map.c index 9cdb58b95c8..d89ba4d7c26 100644 --- a/src/os_posix/os_map.c +++ b/src/os_posix/os_map.c @@ -102,10 +102,13 @@ __wt_posix_map_preload(WT_FILE_HANDLE *fh, * size, so we will be conservative. */ length &= ~(size_t)(conn->page_size - 1); - - if (length <= (size_t)conn->page_size || - (ret = posix_madvise(blk, length, POSIX_MADV_WILLNEED)) == 0) + if (length <= (size_t)conn->page_size) return (0); + + WT_SYSCALL_RETRY(posix_madvise(blk, length, POSIX_MADV_WILLNEED), ret); + if (ret == 0) + return (0); + WT_RET_MSG(session, ret, "%s: memory-map preload: posix_madvise: POSIX_MADV_WILLNEED", fh->name); @@ -135,8 +138,10 @@ __wt_posix_map_discard(WT_FILE_HANDLE *fh, blk = (void *)((uintptr_t)map & ~(uintptr_t)(conn->page_size - 1)); length += WT_PTRDIFF(map, blk); - if ((ret = posix_madvise(blk, length, POSIX_MADV_DONTNEED)) == 0) + WT_SYSCALL_RETRY(posix_madvise(blk, length, POSIX_MADV_DONTNEED), ret); + if (ret == 0) return (0); + WT_RET_MSG(session, ret, "%s: memory-map discard: posix_madvise: POSIX_MADV_DONTNEED", fh->name); diff --git a/src/os_win/os_fs.c b/src/os_win/os_fs.c index c4a1235b61b..4da60d5ffb0 100644 --- a/src/os_win/os_fs.c +++ b/src/os_win/os_fs.c @@ -169,11 +169,6 @@ __win_file_lock( * WiredTiger requires this function be able to acquire locks past * the end of file. * - * Note we're using fcntl(2) locking: all fcntl locks associated with a - * file for a given process are removed when any file descriptor for the - * file is closed by the process, even if a lock was never requested for - * that file descriptor. - * * http://msdn.microsoft.com/ * en-us/library/windows/desktop/aa365202%28v=vs.85%29.aspx * From a27db763dc3d694bf57ec9755fc1b4f0d06a10ab Mon Sep 17 00:00:00 2001 From: sueloverso Date: Thu, 2 Jun 2016 16:30:39 -0400 Subject: [PATCH 4/8] WT-2589 Clear the cursor statistics for LAS when 'clear' is set. (#2772) --- src/cache/cache_las.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/cache/cache_las.c b/src/cache/cache_las.c index fd541458fa8..27c2900fa98 100644 --- a/src/cache/cache_las.c +++ b/src/cache/cache_las.c @@ -42,6 +42,17 @@ __wt_las_stats_update(WT_SESSION_IMPL *session) WT_STAT_SET(session, cstats, cache_lookaside_insert, v); v = WT_STAT_READ(dstats, cursor_remove); WT_STAT_SET(session, cstats, cache_lookaside_remove, v); + /* + * If we're clearing stats we need to clear the cursor values we just + * read. This does not clear the rest of the statistics in the + * lookaside data source stat cursor, but we own that namespace so we + * don't have to worry about users seeing inconsistent data source + * information. + */ + if (FLD_ISSET(conn->stat_flags, WT_CONN_STAT_CLEAR)) { + WT_STAT_SET(session, dstats, cursor_insert, 0); + WT_STAT_SET(session, dstats, cursor_remove, 0); + } } /* From d3a8060e5b8917d8bec927cd54c229e313e22258 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Thu, 2 Jun 2016 22:54:40 -0400 Subject: [PATCH 5/8] WT-2658 Only include PPC-specific files in PPC builds (#2758) * WT-2658 Only include PPC-specific files in PPC builds * Add support for conditional file inclusion by adding a second argument on lines in dist/filelist. Add a new automake conditional, POWERPC_HOST, set for the various PPC host CPUs. Change dist/filelist to only compile the checksum/power8 files if POWERPC_HOST is set. * Merge the Windows and POSIX file lists, use POSIX_HOST and WINDOWS_HOST to mark source files needed for builds on those systems. --- SConstruct | 26 ++++-- build_posix/configure.ac.in | 18 ++-- build_posix/makemake | 22 +++-- build_win/filelist.win | 171 ------------------------------------ dist/dist.py | 15 ++-- dist/filelist | 56 ++++++++---- dist/s_define | 2 +- dist/s_funcs | 2 +- dist/s_prototypes | 2 +- dist/s_stat | 4 +- dist/s_typedef | 2 +- dist/s_win | 35 -------- 12 files changed, 96 insertions(+), 259 deletions(-) delete mode 100644 build_win/filelist.win diff --git a/SConstruct b/SConstruct index c724d94da7c..a5dd8761d6c 100644 --- a/SConstruct +++ b/SConstruct @@ -240,12 +240,26 @@ wtheader = env.Substfile( # # WiredTiger library # -filelistfile = r'build_win\filelist.win' -filelist = open(filelistfile) -wtsources = [line.strip() - for line in filelist - if not line.startswith("#") and len(line) > 1] -filelist.close() +# Map WiredTiger build conditions: any conditions that appear in WiredTiger's +# dist/filelist must appear here, and if the value is true, those files will be +# included. +# +condition_map = { + 'POSIX_HOST' : env['PLATFORM'] == 'posix', + 'POWERPC_HOST' : False, + 'WINDOWS_HOST' : env['PLATFORM'] == 'win32', +} + +def filtered_filelist(f): + for line in f: + file_cond = line.split() + if line.startswith("#") or len(file_cond) == 0: + continue + if len(file_cond) == 1 or condition_map[file_cond[1]]: + yield file_cond[0] + +filelistfile = r'dist/filelist' +wtsources = list(filtered_filelist(open(filelistfile))) if useZlib: wtsources.append("ext/compressors/zlib/zlib_compress.c") diff --git a/build_posix/configure.ac.in b/build_posix/configure.ac.in index 9251873be73..617304f9215 100644 --- a/build_posix/configure.ac.in +++ b/build_posix/configure.ac.in @@ -34,6 +34,16 @@ AC_PROG_CC(cc gcc) AC_PROG_CXX(c++ g++) AM_PROG_AS(as gas) +AM_CONDITIONAL([POSIX_HOST], [true]) +AM_CONDITIONAL([WINDOWS_HOST], [false]) + +AS_CASE([$host_cpu], + [ppc64*], [wt_cv_powerpc="yes"], + [elf64lppc], [wt_cv_powerpc="yes"], + [powerpc*], [wt_cv_powerpc="yes"], + [wt_cv_powerpc="no"]) +AM_CONDITIONAL([POWERPC_HOST], [test "$wt_cv_powerpc" = "yes"]) + # This is a workaround as part of WT-2459. Currently, clang (v3.7) does not # support compiling the ASM code we have to perform the CRC checks on PowerPC. # To compile with clang we need to override the ASM compiler with CCAS to use @@ -41,12 +51,8 @@ AM_PROG_AS(as gas) # determine what tag to use for that one .S file. If we catch that we are using # two different compilers for CC and CCAS and we are on a PowerPC system we # overload the libtool flags to provide CC by default. -if test "$CC" != "$CCAS"; then - AS_CASE([$host_cpu], - [ppc64*], [AM_LIBTOOLFLAGS+="--tag=CC"], - [elf64lppc], [AM_LIBTOOLFLAGS+="--tag=CC"], - [powerpc*], [AM_LIBTOOLFLAGS+="--tag=CC"], - []) +if test "$wt_cv_powerpc" = "yes" -a "$CC" != "$CCAS"; then + [AM_LIBTOOLFLAGS+="--tag=CC"] fi AC_SUBST(AM_LIBTOOLFLAGS) diff --git a/build_posix/makemake b/build_posix/makemake index 9ed9d252911..506420b4aaf 100755 --- a/build_posix/makemake +++ b/build_posix/makemake @@ -7,7 +7,7 @@ (sed -n '1,/BEGIN SUBDIRS/p' Make.base echo "SUBDIRS =" -sed -e 's/#.*$//' -e '/^$/d' Make.subdirs | (while read dir cond ; do +sed -e 's/#.*$//' -e '/^$/d' Make.subdirs | while read dir cond ; do test -d ../$dir || continue if test -n "$cond" ; then cat < $t - - cmp $t $f > /dev/null 2>&1 || - (echo "Building $f" && rm -f $f && cp $t $f) -} - win_config win_export -win_filelist exit 0 From c256c8302b0aa13d402c72e0eedc15e4d529307c Mon Sep 17 00:00:00 2001 From: sueloverso Date: Thu, 2 Jun 2016 23:34:45 -0400 Subject: [PATCH 6/8] SERVER-23659 Improve log error message at startup. (#2766) --- src/include/log.h | 1 + src/log/log.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/include/log.h b/src/include/log.h index 387d0c6c154..7655cfbb3e9 100644 --- a/src/include/log.h +++ b/src/include/log.h @@ -257,6 +257,7 @@ struct __wt_log { uint64_t write_calls; /* Calls to log_write */ #endif +#define WT_LOG_NOT_VERIFIED 0x1 /* Log just started */ uint32_t flags; }; diff --git a/src/log/log.c b/src/log/log.c index 01bfb97718f..56e9f65f914 100644 --- a/src/log/log.c +++ b/src/log/log.c @@ -1090,6 +1090,7 @@ __wt_log_open(WT_SESSION_IMPL *session) logcount = 0; lastlog = 0; firstlog = UINT32_MAX; + F_SET(log, WT_LOG_NOT_VERIFIED); /* * Open up a file handle to the log directory if we haven't. @@ -1744,6 +1745,22 @@ advance: &rd_lsn, WT_LOG_FILENAME, 0)); err: WT_STAT_FAST_CONN_INCR(session, log_scans); + /* + * If the first attempt to read a log record results in + * an error recovery is likely going to fail. Try to provide + * a helpful failure message. + */ + if (ret != 0 && F_ISSET(log, WT_LOG_NOT_VERIFIED)) { + __wt_errx(session, + "WiredTiger is unable to read the recovery log."); + __wt_errx(session, "This may be due to the log" + " files being encrypted, being from an older" + " version or due to corruption on disk"); + __wt_errx(session, "You should confirm that you have" + " opened the database with the correct options including" + " all encryption and compression options"); + } + F_CLR(log, WT_LOG_NOT_VERIFIED); WT_TRET(__wt_fs_directory_list_free(session, &logfiles, logcount)); From 7c4a0a1f597941f28a888e1521ea6ca631d63877 Mon Sep 17 00:00:00 2001 From: Michael Cahill Date: Fri, 3 Jun 2016 13:53:32 +1000 Subject: [PATCH 7/8] WT-2629 Force non-executable stacks based on __ELF__. (#2774) --- src/checksum/power8/crc32.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/checksum/power8/crc32.S b/src/checksum/power8/crc32.S index f990acb7b12..0b7870668b5 100644 --- a/src/checksum/power8/crc32.S +++ b/src/checksum/power8/crc32.S @@ -773,6 +773,6 @@ FUNC_END(__crc32_vpmsum) /* * Make sure the stack isn't executable with GCC (regardless of platform). */ -#ifndef __clang__ +#ifdef __ELF__ .section .note.GNU-stack,"",@progbits #endif From c9dfa31598c33255a5f5710d9b22a1ed648feca3 Mon Sep 17 00:00:00 2001 From: Michael Cahill Date: Fri, 3 Jun 2016 14:23:11 +1000 Subject: [PATCH 8/8] WT-2325 Fix an incomplete comment. --- src/btree/bt_sync.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/btree/bt_sync.c b/src/btree/bt_sync.c index 5d60c436a08..4404069e507 100644 --- a/src/btree/bt_sync.c +++ b/src/btree/bt_sync.c @@ -96,8 +96,10 @@ __sync_file(WT_SESSION_IMPL *session, WT_CACHE_OP syncop) * snapshot now. * * All changes committed up to this point should be included. - * We don't update the snapshot in between pages because (a) - * the metadata shouldn't be that big, and (b) if we do ever + * We don't update the snapshot in between pages because the + * metadata shouldn't have many pages. Instead, read-committed + * isolation ensures that all metadata updates completed before + * the checkpoint are included. */ if (txn->isolation == WT_ISO_READ_COMMITTED) WT_ERR(__wt_txn_get_snapshot(session));