summaryrefslogtreecommitdiff
path: root/libs/libmdbx
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-10-02 14:05:32 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-10-02 14:05:32 +0300
commite123b23e3176dfc83fd6d175d8b211cd83b37fcf (patch)
tree7b4bdefb59b0f2935bdd84e70c2515c1cdb31e82 /libs/libmdbx
parente80d4e54be3f7e0dffc940e63f48f2ea0bb1d3ca (diff)
minor fix for libmdbx
Diffstat (limited to 'libs/libmdbx')
-rw-r--r--libs/libmdbx/src/appveyor.yml8
-rw-r--r--libs/libmdbx/src/src/mdbx.c3
-rw-r--r--libs/libmdbx/src/test/gc.sh32
-rw-r--r--libs/libmdbx/src/test/loop.bat15
-rw-r--r--libs/libmdbx/src/test/osal-windows.cc10
5 files changed, 31 insertions, 37 deletions
diff --git a/libs/libmdbx/src/appveyor.yml b/libs/libmdbx/src/appveyor.yml
index 10a9ab2915..ca70d96265 100644
--- a/libs/libmdbx/src/appveyor.yml
+++ b/libs/libmdbx/src/appveyor.yml
@@ -4,10 +4,10 @@ environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: v141
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: v140
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- TOOLSET: v120
+# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+# TOOLSET: v140
+# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
+# TOOLSET: v120
branches:
except:
diff --git a/libs/libmdbx/src/src/mdbx.c b/libs/libmdbx/src/src/mdbx.c
index 574b4c66dd..0d06f1a191 100644
--- a/libs/libmdbx/src/src/mdbx.c
+++ b/libs/libmdbx/src/src/mdbx.c
@@ -3805,7 +3805,7 @@ static int mdbx_update_gc(MDBX_txn *txn) {
MDBX_cursor mc;
int rc = mdbx_cursor_init(&mc, txn, FREE_DBI);
if (unlikely(rc != MDBX_SUCCESS))
- goto bailout;
+ goto bailout_notracking;
mc.mc_next = txn->mt_cursors[FREE_DBI];
txn->mt_cursors[FREE_DBI] = &mc;
@@ -4423,6 +4423,7 @@ retry:
bailout:
txn->mt_cursors[FREE_DBI] = mc.mc_next;
+bailout_notracking:
if (txn->mt_lifo_reclaimed) {
MDBX_PNL_SIZE(txn->mt_lifo_reclaimed) = 0;
if (txn != env->me_txn0) {
diff --git a/libs/libmdbx/src/test/gc.sh b/libs/libmdbx/src/test/gc.sh
index 0625518a4f..be6991a48f 100644
--- a/libs/libmdbx/src/test/gc.sh
+++ b/libs/libmdbx/src/test/gc.sh
@@ -23,45 +23,17 @@ function probe {
echo "=============================================== $(date)"
echo "${caption}: $*"
rm -f ${TESTDB_PREFIX}* \
- && ./mdbx_test --pathname=${TESTDB_PREFIX}db "$@" | lz4 > log.lz4 \
+ && ./mdbx_test --pathname=${TESTDB_PREFIX}db "$@" | lz4 > ${TESTDB_PREFIX}log.lz4 \
&& ./mdbx_chk -nvvv ${TESTDB_PREFIX}db | tee ${TESTDB_PREFIX}chk \
|| (echo "FAILED"; exit 1)
}
###############################################################################
-caption="Failfast #1" probe \
- --pagesize=min --size=6G --table=+data.dups --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
- --nops=99999 --batch.write=9 --mode=-writemap,-coalesce,+lifo --keygen.seed=248240655 basic
-
-caption="Failfast #2" probe \
- --pagesize=min --size=6G --table=-data.dups --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
- --nops=999999 --batch.write=999 --mode=+writemap,+coalesce,+lifo --keygen.seed=259083046 basic
-
-caption="Failfast #3" probe \
- --pagesize=min --size=6G --table=-data.dups --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
- --nops=999999 --batch.write=999 --mode=+writemap,+coalesce,+lifo --keygen.seed=522365681 basic
-
-caption="Failfast #4" probe \
- --pagesize=min --size=6G --table=-data.dups --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
- --nops=999999 --batch.write=9999 --mode=-writemap,+coalesce,+lifo --keygen.seed=866083781 basic
-
-caption="Failfast #5" probe \
- --pagesize=min --size=6G --table=-data.dups --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
- --nops=999999 --batch.write=999 --mode=+writemap,-coalesce,+lifo --keygen.seed=246539192 basic
-
-caption="Failfast #6" probe \
- --pagesize=min --size=6G --table=-data.dups --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
- --nops=999999 --batch.write=999 --mode=+writemap,+coalesce,+lifo --keygen.seed=540406278 basic
-
-caption="Failfast #7" probe \
- --pagesize=min --size=6G --table=+data.dups --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
- --nops=999999 --batch.write=999 --mode=-writemap,+coalesce,+lifo --keygen.seed=619798690 basic
-
count=0
for nops in {2..7}; do
for ((wbatch=nops-1; wbatch > 0; --wbatch)); do
- loops=$((1111/nops + 2))
+ loops=$(((3333 >> nops) / nops + 1))
for ((rep=0; rep++ < loops; )); do
for ((bits=2**${#options[@]}; --bits >= 0; )); do
seed=$(date +%N)
diff --git a/libs/libmdbx/src/test/loop.bat b/libs/libmdbx/src/test/loop.bat
new file mode 100644
index 0000000000..0e3b6271c9
--- /dev/null
+++ b/libs/libmdbx/src/test/loop.bat
@@ -0,0 +1,15 @@
+@echo off
+
+del test.db test.db-lck
+
+:loop
+
+mdbx_test.exe --pathname=test.db --dont-cleanup-after basic > test.log
+if errorlevel 1 goto fail
+
+mdbx_chk.exe -nvvv test.db > chk.log
+if errorlevel 1 goto fail
+goto loop
+
+:fail
+echo FAILED
diff --git a/libs/libmdbx/src/test/osal-windows.cc b/libs/libmdbx/src/test/osal-windows.cc
index 81f1da7f86..7d59f657c2 100644
--- a/libs/libmdbx/src/test/osal-windows.cc
+++ b/libs/libmdbx/src/test/osal-windows.cc
@@ -262,12 +262,18 @@ int osal_actor_start(const actor_config &config, mdbx_pid_t &pid) {
STARTUPINFOA StartupInfo;
GetStartupInfoA(&StartupInfo);
- char exename[_MAX_PATH];
+ char exename[_MAX_PATH + 1];
DWORD exename_size = sizeof(exename);
if (!QueryFullProcessImageNameA(GetCurrentProcess(), 0, exename,
&exename_size))
failure_perror("QueryFullProcessImageName()", GetLastError());
+ if (exename[1] != ':') {
+ exename_size = GetModuleFileName(NULL, exename, sizeof(exename));
+ if (exename_size >= sizeof(exename))
+ return ERROR_BAD_LENGTH;
+ }
+
std::string cmdline = "$ ";
ArgvQuote(cmdline, thunk_param(config));
@@ -283,7 +289,7 @@ int osal_actor_start(const actor_config &config, mdbx_pid_t &pid) {
NULL, // Inherit the parent's environment.
NULL, // Inherit the parent's current directory.
&StartupInfo, &ProcessInformation))
- return GetLastError();
+ failure_perror(exename, GetLastError());
CloseHandle(ProcessInformation.hThread);
pid = ProcessInformation.dwProcessId;