diff options
author | Luke Chen <luke.chen@mongodb.com> | 2021-03-18 16:04:28 +1100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-03-18 05:26:55 +0000 |
commit | d1677c26b4448ba4cfcabab9505fb9dfcb4a32da (patch) | |
tree | 59d9295528194a83ec07b95721e472b86f63934f | |
parent | 50f5691a67c71f3cf969205037aff2c44f6160e2 (diff) | |
download | mongo-d1677c26b4448ba4cfcabab9505fb9dfcb4a32da.tar.gz |
Import wiredtiger: 195c82322f15ab3a1a7ca2b9c6e34ef31dac96d3 from branch mongodb-5.0
ref: 31624ffd8c..195c82322f
for: 4.9.0
WT-7295 Compatibility with older versions of WT
11 files changed, 56 insertions, 1 deletions
diff --git a/src/third_party/wiredtiger/SConstruct b/src/third_party/wiredtiger/SConstruct index ed1ef0e8351..006b0bfce08 100644 --- a/src/third_party/wiredtiger/SConstruct +++ b/src/third_party/wiredtiger/SConstruct @@ -23,6 +23,9 @@ AddOption("--dynamic-crt", dest="dynamic-crt", action="store_true", default=Fals AddOption("--enable-attach", dest="attach", action="store_true", default=False, help="Configure for debugger attach on failure.") +AddOption("--disable-standalone-build", dest="standalone-build", action="store_true", default=False, + help="Disable WT Standalone build.") + AddOption("--enable-diagnostic", dest="diagnostic", action="store_true", default=False, help="Configure WiredTiger to perform various run-time diagnostic tests. DO NOT configure this option in production environments.") @@ -172,6 +175,11 @@ if GetOption("lang-python"): env.Append(LIBPATH=[distutils.sysconfig.PREFIX + r"\libs"]) env.Append(CPPPATH=[distutils.sysconfig.get_python_inc()]) +disableStandaloneBuild = GetOption("standalone-build") +if disableStandaloneBuild: + print('Disable Standalone Build') +else: + env.Append(CPPDEFINES = ["WT_STANDALONE_BUILD"]) # Build WiredTiger.h file # diff --git a/src/third_party/wiredtiger/build_posix/aclocal/options.m4 b/src/third_party/wiredtiger/build_posix/aclocal/options.m4 index 34802b9634f..06821d988dc 100644 --- a/src/third_party/wiredtiger/build_posix/aclocal/options.m4 +++ b/src/third_party/wiredtiger/build_posix/aclocal/options.m4 @@ -247,6 +247,20 @@ no) wt_cv_crc32_hardware=no AC_MSG_RESULT(no);; esac +AH_TEMPLATE(WT_STANDALONE_BUILD, + [Define to 1 to support standalone build.]) +AC_MSG_CHECKING(if --disable-standalone-build option specified) +AC_ARG_ENABLE(standalone-build, + [AS_HELP_STRING([--disable-standalone-build], + [Disable standalone build support.])], r=$enableval, r=yes) +case "$r" in +no) wt_cv_disable_standalone_build=no + AC_MSG_RESULT(yes);; +*) wt_cv_disable_standalone_build=yes + AC_DEFINE(WT_STANDALONE_BUILD) + AC_MSG_RESULT(no);; +esac + AC_MSG_CHECKING(if --enable-llvm option specified) AC_ARG_ENABLE(llvm, [AS_HELP_STRING([--enable-llvm], diff --git a/src/third_party/wiredtiger/build_win/wiredtiger_config.h b/src/third_party/wiredtiger/build_win/wiredtiger_config.h index 8c4e32875a4..51a6af73856 100644 --- a/src/third_party/wiredtiger/build_win/wiredtiger_config.h +++ b/src/third_party/wiredtiger/build_win/wiredtiger_config.h @@ -73,6 +73,9 @@ /* Define to 1 to disable any crc32 hardware support. */ /* #undef HAVE_NO_CRC32_HARDWARE */ +/* Define to 1 to disable standalone wiredtiger build. */ +/* #undef WT_STANDALONE_BUILD */ + /* Define to 1 if pthread condition variables support monotonic clocks. */ /* #undef HAVE_PTHREAD_COND_MONOTONIC */ diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index c0278929937..82195d5a1bf 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -2,5 +2,5 @@ "vendor": "wiredtiger", "github": "wiredtiger/wiredtiger.git", "branch": "mongodb-5.0", - "commit": "31624ffd8c6eb39794ddd6c41cb48db42a646a87" + "commit": "195c82322f15ab3a1a7ca2b9c6e34ef31dac96d3" } diff --git a/src/third_party/wiredtiger/src/docs/build-posix.dox b/src/third_party/wiredtiger/src/docs/build-posix.dox index 2b263139ad9..e0eb1577b29 100644 --- a/src/third_party/wiredtiger/src/docs/build-posix.dox +++ b/src/third_party/wiredtiger/src/docs/build-posix.dox @@ -140,6 +140,10 @@ compression; see @ref compression for more information. Configure WiredTiger for <a href="https://github.com/facebook/zstd">Zstd</a> compression; see @ref compression for more information. +@par \c --disable-standalone-build +Configure WiredTiger to disable standalone build. Standalone build is enabled +by default. + @par <code>--with-builtins</code> Configure WiredTiger to include support for extensions in the main library. This avoids requiring additional libraries for supported extensions. Currently diff --git a/src/third_party/wiredtiger/src/docs/build-windows.dox b/src/third_party/wiredtiger/src/docs/build-windows.dox index 724fe9bc589..d45f479ce57 100644 --- a/src/third_party/wiredtiger/src/docs/build-windows.dox +++ b/src/third_party/wiredtiger/src/docs/build-windows.dox @@ -101,4 +101,8 @@ compression; see @ref compression for more information. Configure WiredTiger for <a href="http://www.zlib.net/">zlib</a> compression; see @ref compression for more information. +@par \c --disable-standalone-build +Configure WiredTiger to disable standalone build. Standalone build is enabled +by default. + */ diff --git a/src/third_party/wiredtiger/src/docs/upgrade.dox b/src/third_party/wiredtiger/src/docs/upgrade.dox index 9f8331c9b1f..3c43b41a313 100644 --- a/src/third_party/wiredtiger/src/docs/upgrade.dox +++ b/src/third_party/wiredtiger/src/docs/upgrade.dox @@ -85,5 +85,9 @@ To downgrade to a previous release of WiredTiger: -# Shut down the new version of the application. <br><br> -# Start the old version of the application. +<br><br> +-# The database created with version 10.0 cannot be downgraded to older + versions because underlying file formats changed between the 10.0.0 + release and the 3.2.1 release. */ diff --git a/src/third_party/wiredtiger/src/include/btree.h b/src/third_party/wiredtiger/src/include/btree.h index b2f6ba2dfb1..8fe26d5261b 100644 --- a/src/third_party/wiredtiger/src/include/btree.h +++ b/src/third_party/wiredtiger/src/include/btree.h @@ -12,7 +12,13 @@ #define WT_BTREE_MAJOR_VERSION_MIN 1 /* Oldest version supported */ #define WT_BTREE_MINOR_VERSION_MIN 1 +/* Increase the version number for standalone build. */ +#ifdef WT_STANDALONE_BUILD +#define WT_BTREE_MAJOR_VERSION_MAX 2 /* Newest version supported */ +#else #define WT_BTREE_MAJOR_VERSION_MAX 1 /* Newest version supported */ +#endif + #define WT_BTREE_MINOR_VERSION_MAX 1 #define WT_BTREE_MIN_ALLOC_SIZE 512 diff --git a/src/third_party/wiredtiger/src/meta/meta_ckpt.c b/src/third_party/wiredtiger/src/meta/meta_ckpt.c index 6b6a8091695..96ed8cb72a4 100644 --- a/src/third_party/wiredtiger/src/meta/meta_ckpt.c +++ b/src/third_party/wiredtiger/src/meta/meta_ckpt.c @@ -111,8 +111,18 @@ __wt_meta_checkpoint( /* Retrieve the metadata entry for the file. */ WT_ERR(__wt_metadata_search(session, fname, &config)); +/* + * Check for the version mismatch in wiredtiger standalone build when compatibility has not been + * configured. + */ +#ifdef WT_STANDALONE_BUILD + if (!F_ISSET(S2C(session), WT_CONN_COMPATIBILITY)) + /* Check the major/minor version numbers. */ + WT_ERR(__ckpt_version_chk(session, fname, config)); +#else /* Check the major/minor version numbers. */ WT_ERR(__ckpt_version_chk(session, fname, config)); +#endif /* * Retrieve the named checkpoint or the last checkpoint. diff --git a/src/third_party/wiredtiger/test/evergreen/compatibility_test_for_releases.sh b/src/third_party/wiredtiger/test/evergreen/compatibility_test_for_releases.sh index e7c50dfa922..4d5a04bf0e7 100755 --- a/src/third_party/wiredtiger/test/evergreen/compatibility_test_for_releases.sh +++ b/src/third_party/wiredtiger/test/evergreen/compatibility_test_for_releases.sh @@ -47,6 +47,7 @@ build_branch() config="" config+="--enable-snappy " + config+="--disable-standalone-build " (sh build_posix/reconf && ./configure $config && make -j $(grep -c ^processor /proc/cpuinfo)) > /dev/null } diff --git a/src/third_party/wiredtiger/test/evergreen/import_compatibility_test.sh b/src/third_party/wiredtiger/test/evergreen/import_compatibility_test.sh index 6f0ba25ee09..3c3c8364d66 100755 --- a/src/third_party/wiredtiger/test/evergreen/import_compatibility_test.sh +++ b/src/third_party/wiredtiger/test/evergreen/import_compatibility_test.sh @@ -23,6 +23,7 @@ build_branch() config="" config+="--enable-snappy " + config+="--disable-standalone-build " (sh build_posix/reconf && ./configure $config && make -j $(grep -c ^processor /proc/cpuinfo)) > /dev/null cd .. |