summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2022-12-21 15:39:11 +1100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-12-21 05:14:15 +0000
commit8bc7090e08c7835a6e2efb9592ceb37153709cd8 (patch)
treed572b957951e5857f45cdf75a85da3e9c4acc996
parent6cd0e5c322cf8cc1b24722543a0f7e5604f85ed8 (diff)
downloadmongo-8bc7090e08c7835a6e2efb9592ceb37153709cd8.tar.gz
Import wiredtiger: e9069c3e5fd23c16d16e7f62f8b4d3ac2327d24a from branch mongodb-master
ref: 9d1ff63951..e9069c3e5f for: 6.3.0-rc0 WT-10300 Move evergreen validation into its own dist/ script, speeding up s_fast.
-rwxr-xr-xsrc/third_party/wiredtiger/dist/s_all32
-rwxr-xr-xsrc/third_party/wiredtiger/dist/s_clang_format1
-rwxr-xr-xsrc/third_party/wiredtiger/dist/s_evergreen_validate45
-rwxr-xr-xsrc/third_party/wiredtiger/dist/s_function43
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/include/cache_inline.h2
6 files changed, 88 insertions, 37 deletions
diff --git a/src/third_party/wiredtiger/dist/s_all b/src/third_party/wiredtiger/dist/s_all
index 1f59a664811..7b6e291f62c 100755
--- a/src/third_party/wiredtiger/dist/s_all
+++ b/src/third_party/wiredtiger/dist/s_all
@@ -13,7 +13,7 @@ type python > /dev/null 2>&1 || {
echo 'dist/s_all run started...'
-fast=1
+fast=""
force=
reconf=0
errmode=0
@@ -32,7 +32,7 @@ while :
shift;;
-F) # Run fast.
echo "dist/s_all running in fast mode..."
- fast=0
+ fast="-F"
shift;;
*)
break;;
@@ -48,14 +48,6 @@ errchk()
return
fi
- # Return if evergreen validate runs successfully.
- if echo "$1" | grep -q "evergreen"; then
- if cat "$2" | grep -q ".yml is valid"; then
- rm -f "$2"
- return
- fi
- fi
-
echo "####################### MESSAGE ############################"
echo "s_all run of: \"$1\" resulted in:"
sed -e 's/^/ /' $2
@@ -91,33 +83,23 @@ run "python log.py"
run "python stat.py"
run "python verbose.py"
run "sh ./s_copyright"
-if [ $fast -eq 0 ]; then
- run "sh ./s_style -F"
- run "./s_clang_format -F"
-else
- run "sh ./s_style"
- run "./s_clang_format"
-fi
+run "sh ./s_style ${fast}"
+run "./s_clang_format ${fast}"
run "python prototypes.py"
run "sh ./s_typedef -b"
run "python test_tag.py"
# The s_mentions script requires bash.
run "./s_mentions" "--warning-only"
-if [ $(command -v evergreen) ] && [ -f ~/.evergreen.yml ]; then
- run "cd .."
- run "evergreen validate -p wiredtiger test/evergreen.yml"
- run "evergreen validate -p wiredtiger test/evergreen_develop.yml"
- run "cd dist"
-fi
COMMANDS="
2>&1 ./s_define > ${t_pfx}s_define
2>&1 ./s_docs > ${t_pfx}s_docs
2>&1 ./s_evergreen > ${t_pfx}s_evergreen
+2>&1 ./s_evergreen_validate ${fast} > ${t_pfx}s_evergreen_validate
2>&1 ./s_export > ${t_pfx}s_export
2>&1 ./s_free > ${t_pfx}s_free
2>&1 ./s_funcs > ${t_pfx}s_funcs
-2>&1 ./s_function > ${t_pfx}s_function
+2>&1 ./s_function ${fast} > ${t_pfx}s_function
2>&1 ./s_getopt > ${t_pfx}s_getopt
2>&1 ./s_lang > ${t_pfx}s_lang
2>&1 ./s_longlines > ${t_pfx}s_longlines
@@ -144,7 +126,7 @@ for f in `find . -name ${t_pfx}\*`; do
LOCAL_NAME=`basename $f`
# Find original command and trim redirect garbage
FAILED_CMD=`echo "$COMMANDS" | grep $LOCAL_NAME | \
- sed -e 's/ >.*//' -e 's/.* //'`
+ sed -e 's/ >.*//' -e 's/2>&1 //'`
errchk "$FAILED_CMD" $f
fi
done
diff --git a/src/third_party/wiredtiger/dist/s_clang_format b/src/third_party/wiredtiger/dist/s_clang_format
index 46b18f4913d..5e92e0372e3 100755
--- a/src/third_party/wiredtiger/dist/s_clang_format
+++ b/src/third_party/wiredtiger/dist/s_clang_format
@@ -58,7 +58,6 @@ case $# in
if [ $1 == "-F" ]; then
# We are running in fast mode, get all the source files modified according to git.
search=`git diff --name-only $(git merge-base --fork-point develop) | grep -E '\.(c|h|cpp)$'`
- echo $search
else
search="$1"
exclude=false
diff --git a/src/third_party/wiredtiger/dist/s_evergreen_validate b/src/third_party/wiredtiger/dist/s_evergreen_validate
new file mode 100755
index 00000000000..014814a6c2c
--- /dev/null
+++ b/src/third_party/wiredtiger/dist/s_evergreen_validate
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+t=__wt.$$
+trap 'rm -f $t' 0 1 2 3 13 15
+
+fast=false
+case "$1" in
+ -F) # Run fast.
+ fast=true
+ shift;;
+ *)
+ if test $# -gt 1 ; then
+ echo "Usage: $0 [-F]"
+ echo "-F only run validation commands if evergreen yml files have been modified"
+ fi
+ break;;
+esac
+
+if [ $(command -v evergreen) ] && [ -f ~/.evergreen.yml ]; then
+ if $fast ; then
+ # Check the evergreen.yml files for modifications.
+ search=`git diff --name-only $(git merge-base --fork-point develop) | grep -E 'evergreen.*\.yml$'`
+ # If we didn't find any files then exit.
+ if test -z $search; then
+ exit 0
+ fi
+ fi
+ cd ..
+ echo "Validating evergreen.yml " > dist/$t
+ evergreen validate -p wiredtiger test/evergreen.yml >> dist/$t 2>&1
+ exit1=$?
+ echo "=-=-=-=-=-=-=-=-=-=-=" >> dist/$t
+ echo "Validating evergreen_develop.yml" >> dist/$t
+ evergreen validate -p wiredtiger test/evergreen_develop.yml >> dist/$t 2>&1
+ exit2=$?
+ cd dist
+fi
+
+if test $exit1 -ne 0 -o $exit2 -ne 0 ; then
+ echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
+ echo "$0 failed with output:"
+ cat $t
+ echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
+fi
+exit 0
diff --git a/src/third_party/wiredtiger/dist/s_function b/src/third_party/wiredtiger/dist/s_function
index c36afa19036..07f7ace2c83 100755
--- a/src/third_party/wiredtiger/dist/s_function
+++ b/src/third_party/wiredtiger/dist/s_function
@@ -4,6 +4,19 @@
t=__wt.$$
trap 'rm -f $t' 0 1 2 3 13 15
+fast=1
+case "$1" in
+ -F) # Run fast.
+ fast=0
+ shift;;
+ *)
+ if test $# -gt 1 ; then
+ echo "Usage: $0 [-F]"
+ echo "-F only run function validation on modified soure files."
+ fi
+ break;;
+esac
+
cd ..
# Turn a C file into a line per function so we can use grep on it.
@@ -19,9 +32,15 @@ file_parse()
-e '{s/.*//;x;}'
}
+if test $fast -eq 1 ; then
+ files=`find bench examples ext src test -name '*.c' -o -name '*_inline.h'`
+else
+ files=`git diff --name-only $(git merge-base --fork-point develop) bench examples ext src test | grep -E '(.c|_inline.h)$'`
+fi
+
# Returns in functions after a jump to the error label, or an infinite loop
# where there's a jump to the error label after the error label.
-for f in `find bench examples ext src test -name '*.c' -o -name '*_inline.h'`; do
+for f in $files; do
file_parse $f |
egrep '(WT_ERR[_A-Z]*)\(.*(WT_RET[_A-Z]*)\(.*err:|[^a-z_]err:.*(WT_ERR)\(' |
sed 's/:.*//' > $t
@@ -34,14 +53,14 @@ done
# Returns before jumps to an error label within the same loop.
# Jumps before returns have already been detected above.
-for f in `find bench examples ext src test -name '*.c' -o -name '*._inline.h'`; do
+for f in $files; do
file_parse $f | sed "s=^=$f:="
done | python dist/s_function_loop.py |
egrep '\{@[^@]*(WT_RET[_A-Z]*)\([^@]*(WT_ERR[_A-Z]*)\(.*err:' |
sed -e 's/^\([^:]*\): *\([^:]*\):.*/\1:\2: mix of returns and jump to the error label within a loop/'
# Early exits from WT_WITH_* macros.
-for f in $(grep -l 'WT_WITH_' $(find bench examples ext src test -name '*.c' -o -name '*_inline.h')); do
+for f in $(grep -l 'WT_WITH_' $files); do
echo "===$f==="
cat $f
done | python dist/s_function_with.py 2>&1 $t || exit 1
@@ -51,7 +70,7 @@ test -s $t && {
}
# Return of 0 in functions after a jump to the error label.
-for f in `find bench examples ext src test -name '*.c' -o -name '*._inline.h'`; do
+for f in $files; do
file_parse $f |
egrep -v '[^a-z_]err:.*return \(ret|[^a-z_]err:.*WT_RET' |
egrep '[^a-z_]err:.*return \(0\);' |
@@ -64,7 +83,7 @@ for f in `find bench examples ext src test -name '*.c' -o -name '*._inline.h'`;
done
# Early exits from critical loops.
-for f in `find bench examples ext src test -name '*.c' -o -name '*._inline.h'`; do
+for f in $files; do
sed -n -e '/API_CALL.*;$/,/API_END.*;/{=;p;}' \
-e '/LSM_.*ENTER*;$/,/LSM_.*LEAVE*;/{=;p;}' \
-e '/WT_TRACK_OP_INIT/,/WT_TRACK_OP_END/{=;p;}' \
@@ -76,7 +95,7 @@ for f in `find bench examples ext src test -name '*.c' -o -name '*._inline.h'`;
done
# API_END with a return
-for f in `find bench examples ext src test -name '*.c' -o -name '*._inline.h'`; do
+for f in $files; do
file_parse $f |
egrep '[^A-Z_]API_END.*return' |
sed 's/:.*//' > $t
@@ -87,7 +106,7 @@ for f in `find bench examples ext src test -name '*.c' -o -name '*._inline.h'`;
done
# S2C with a local WT_CONNECTION_IMPL variable.
-for f in `find bench examples ext src test -name '*.c' -o -name '*._inline.h'`; do
+for f in $files; do
file_parse $f |
egrep 'conn = S2C.*S2C' |
sed 's/:.*//' > $t
@@ -98,7 +117,7 @@ for f in `find bench examples ext src test -name '*.c' -o -name '*._inline.h'`;
done
# S2B with a local WT_BTREE variable.
-for f in `find bench examples ext src test -name '*.c' -o -name '*._inline.h'`; do
+for f in $files; do
file_parse $f |
egrep 'btree = S2B.*S2B' |
sed 's/:.*//' > $t
@@ -108,8 +127,14 @@ for f in `find bench examples ext src test -name '*.c' -o -name '*._inline.h'`;
}
done
+if test $fast -eq 1 ; then
+ files=`find src -name '*.c' -o -name '*._inline.h'`
+else
+ files=`git diff --name-only $(git merge-base --fork-point develop) src | grep -E '(.c|_inline.h)$'`
+fi
+
# __wt_verbose with a bitwise OR category parameter.
-for f in `find src -name '*.c' -o -name '*._inline.h'`; do
+for f in $files; do
file_parse $f | python dist/s_function_verbose.py > $t
test -s $t && {
echo "$f: Invalid use of verbose category parameter (bitwise OR)."
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 93f2f524b50..65e1cde22cd 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-master",
- "commit": "9d1ff639515cbca3c1447549bfb61114f59987ee"
+ "commit": "e9069c3e5fd23c16d16e7f62f8b4d3ac2327d24a"
}
diff --git a/src/third_party/wiredtiger/src/include/cache_inline.h b/src/third_party/wiredtiger/src/include/cache_inline.h
index 79c803adb63..8bb8dae8be5 100644
--- a/src/third_party/wiredtiger/src/include/cache_inline.h
+++ b/src/third_party/wiredtiger/src/include/cache_inline.h
@@ -422,7 +422,7 @@ __wt_cache_hs_dirty(WT_SESSION_IMPL *session)
uint64_t bytes_max;
conn = S2C(session);
cache = conn->cache;
- bytes_max = S2C(session)->cache_size;
+ bytes_max = conn->cache_size;
return (__wt_cache_bytes_plus_overhead(cache, cache->bytes_hs_dirty) >=
((uint64_t)(cache->eviction_dirty_trigger * bytes_max) / 100));