mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 11:31:51 +01:00
Addresses #2257 refs[t:2257] Merge windows port back into main.
git-svn-id: file:///svn/toku/tokudb@16673 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
e339d26531
commit
324c278a31
272 changed files with 916 additions and 495 deletions
10
Makefile
10
Makefile
|
@ -15,13 +15,17 @@ endif
|
|||
SRCDIRS = $(OS_CHOICE) newbrt src/range_tree src/lock_tree src utils db-benchmark-test $(SRCDIRS_CXX)
|
||||
BUILDDIRS = $(SRCDIRS) man/texi
|
||||
|
||||
ifeq ($(OS_CHOICE),windows)
|
||||
.NOTPARALLEL:; #Windows/cygwin jobserver does not properly handle submakes. Serialize
|
||||
endif
|
||||
newbrt.dir: $(OS_CHOICE).dir
|
||||
src/range_tree.dir: $(OS_CHOICE).dir
|
||||
src/lock_tree.dir: src/range_tree.dir
|
||||
src.dir: newbrt.dir src/lock_tree.dir
|
||||
cxx.dir: src.dir
|
||||
db-benchmark-test.dir: src.dir
|
||||
db-benchmark-test-cxx.dir: cxx.dir
|
||||
utils.dir: src.dir
|
||||
db-benchmark-test.dir: src.dir
|
||||
cxx.dir: src.dir
|
||||
db-benchmark-test-cxx.dir: cxx.dir
|
||||
|
||||
%.dir:
|
||||
cd $(patsubst %.dir, %, $@) && $(MAKE) build
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <db.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#define DIR "subcommit.dir"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <db.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
|
||||
|
||||
#define DECL_LIMIT 100
|
||||
|
|
|
@ -71,14 +71,14 @@ SUPPORT_ROWSIZE=$$((80*1024)) # at least 80KiB
|
|||
|
||||
.PHONY: check-rowsize check-rowsize-dup
|
||||
check-rowsize: $(TARGET_TDB)
|
||||
$(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) --env rowsize.key.dir --keysize $(SUPPORT_KEYSIZE) --periter 256 1 $(SUMMARIZE_CMD)
|
||||
$(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) --env rowsize.val.dir --valsize $(SUPPORT_ROWSIZE) --periter 256 1 $(SUMMARIZE_CMD)
|
||||
$(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) --env rowsize.keyval.dir --keysize $(SUPPORT_KEYSIZE) --valsize $(SUPPORT_ROWSIZE) --periter 256 1 $(SUMMARIZE_CMD)
|
||||
( $(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) --env rowsize.key.dir --keysize $(SUPPORT_KEYSIZE) --periter 256 1 && \
|
||||
$(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) --env rowsize.val.dir --valsize $(SUPPORT_ROWSIZE) --periter 256 1 && \
|
||||
$(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) --env rowsize.keyval.dir --keysize $(SUPPORT_KEYSIZE) --valsize $(SUPPORT_ROWSIZE) --periter 256 1 ) $(SUMMARIZE_CMD)
|
||||
|
||||
check-rowsize-dup: $(TARGET_TDB)
|
||||
$(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) --env rowsize.dup.key.dir --dupsort --keysize $(SUPPORT_KEYSIZE) --periter 256 1 $(SUMMARIZE_CMD)
|
||||
$(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) --env rowsize.dup.val.dir --valsize $(SUPPORT_ROWSIZE) --periter 256 1 $(SUMMARIZE_CMD)
|
||||
$(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) --env rowsize.dup.keyval.dir --dupsort --keysize $(SUPPORT_KEYSIZE) --valsize $(SUPPORT_ROWSIZE) --periter 256 1 $(SUMMARIZE_CMD)
|
||||
( $(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) --env rowsize.dup.key.dir --dupsort --keysize $(SUPPORT_KEYSIZE) --periter 256 1 && \
|
||||
$(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) --env rowsize.dup.val.dir --valsize $(SUPPORT_ROWSIZE) --periter 256 1 && \
|
||||
$(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) --env rowsize.dup.keyval.dir --dupsort --keysize $(SUPPORT_KEYSIZE) --valsize $(SUPPORT_ROWSIZE) --periter 256 1 ) $(SUMMARIZE_CMD)
|
||||
|
||||
check-default: $(TARGET_TDB)
|
||||
$(VGRIND) ./$(TARGET_TDB) $(VERBVERBOSE) $(SUMMARIZE_CMD)
|
||||
|
@ -88,8 +88,8 @@ check-x: $(TARGET_TDB)
|
|||
|
||||
# check-scanrace: VGRIND=tcheck_cl -w 140 -s 4 -p nothreads,delay=2,stall=900,noverbose
|
||||
check-scanrace: $(SCANRACE_TDB) $(TARGET_TDB)
|
||||
./$(TARGET_TDB) --env scanrace.tokudb --periter 10000 --pagesize 4096 1
|
||||
$(VGRIND) ./$(SCANRACE_TDB) --env scanrace.tokudb $(SUMMARIZE_CMD)
|
||||
( ./$(TARGET_TDB) --env scanrace.tokudb --periter 10000 --pagesize 4096 1 && \
|
||||
$(VGRIND) ./$(SCANRACE_TDB) --env scanrace.tokudb ) $(SUMMARIZE_CMD)
|
||||
|
||||
# A fast transaction test that detects #455.
|
||||
check-xfast: $(TARGET_TDB)
|
||||
|
@ -101,9 +101,9 @@ check-no-rolltmp: $(TARGET_TDB)
|
|||
|
||||
# Check to make sure that if we make a file that's bigger than 4GB that we can read the file back out and get all the rows.
|
||||
check-4G: $(TARGET_TDB) $(SCANSCAN_TDB)
|
||||
./$(TARGET_TDB) $(VERBVERBOSE) --env 4g.dir --norandom --compressibility 1 --valsize 10000 1
|
||||
./$(SCANSCAN_TDB) --env 4g.dir --lwc --prelock --prelockflag --nox > 4g.out
|
||||
fgrep "(1048576 rows)" 4g.out > /dev/null
|
||||
( ./$(TARGET_TDB) $(VERBVERBOSE) --env 4g.dir --norandom --compressibility 1 --valsize 10000 1 && \
|
||||
./$(SCANSCAN_TDB) --env 4g.dir --lwc --prelock --prelockflag --nox > 4g.out && \
|
||||
fgrep "(1048576 rows)" 4g.out > /dev/null ) $(SUMMARIZE_CMD)
|
||||
|
||||
clean:
|
||||
rm -f $(TARGETS) 4g.out
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <toku_portability.h>
|
||||
#include <toku_time.h>
|
||||
#include <db.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
@ -86,13 +86,13 @@ static unsigned char get_random_c(void) {
|
|||
return random_c[next_random_c];
|
||||
}
|
||||
|
||||
static int min(int a, int b) {
|
||||
static int min_int(int a, int b) {
|
||||
return a > b ? b : a;
|
||||
}
|
||||
|
||||
static void copy_random_c(unsigned char *p, int n) {
|
||||
while (n > 0) {
|
||||
int m = min(n, MAX_RANDOM_C-next_random_c);
|
||||
int m = min_int(n, MAX_RANDOM_C-next_random_c);
|
||||
memcpy(p, &random_c[next_random_c], m);
|
||||
n -= m;
|
||||
p += m;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* Scan the bench.tokudb/bench.db over and over. */
|
||||
|
||||
#include <toku_portability.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <db.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <string.h>
|
||||
#if defined(__linux__)
|
||||
#include <bits/wordsize.h>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include "toku_os.h"
|
||||
|
||||
int main(void) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* Verify that toku_os_pwrite does the right thing when writing beyond 4GB. */
|
||||
#include <fcntl.h>
|
||||
#include <test.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
|
||||
int test_main(int argc, char *argv[]) {
|
||||
char fname[] = "pwrite4g.data";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <sys/thr.h>
|
||||
#include "toku_os.h"
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <toku_atomic.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
//Print any necessary errors
|
||||
|
@ -20,7 +20,7 @@ try_again_after_handling_write_error(int fd, size_t len, ssize_t r_write) {
|
|||
char err_msg[sizeof("Write of [] bytes to fd=[] interrupted. Retrying.") + 20+10]; //64 bit is 20 chars, 32 bit is 10 chars
|
||||
snprintf(err_msg, sizeof(err_msg), "Write of [%"PRIu64"] bytes to fd=[%d] interrupted. Retrying.", (uint64_t)len, fd);
|
||||
perror(err_msg);
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
try_again = 1;
|
||||
break;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ try_again_after_handling_write_error(int fd, size_t len, ssize_t r_write) {
|
|||
char err_msg[sizeof("Failed write of [] bytes to fd=[].") + 20+10]; //64 bit is 20 chars, 32 bit is 10 chars
|
||||
snprintf(err_msg, sizeof(err_msg), "Failed write of [%"PRIu64"] bytes to fd=[%d].", (uint64_t)len, fd);
|
||||
perror(err_msg);
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
int out_of_disk_space = 1;
|
||||
assert(!out_of_disk_space); //Give an error message that might be useful if this is the only one that survives.
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/file.h>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <toku_stdint.h>
|
||||
#include <toku_os.h>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/wait.h>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <unistd.h>
|
||||
#include <toku_time.h>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <toku_time.h>
|
||||
|
||||
int main(void) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include <toku_stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <string.h>
|
||||
#include "toku_os.h"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include <toku_stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include "toku_os.h"
|
||||
|
||||
int main(void) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <memory.h>
|
||||
#include <toku_pthread.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <string.h>
|
||||
#include <toku_stdint.h>
|
||||
#include <toku_os.h>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include <toku_stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include "toku_os.h"
|
||||
#include <syscall.h>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
|
||||
int main(void) {
|
||||
assert(0);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
long long parsell (char *s) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
long long parsell (char *s) {
|
||||
|
|
|
@ -112,7 +112,7 @@ log_code.$(OEXT): log_header.h wbuf.h log-internal.h rbuf.h
|
|||
# So we do it this way
|
||||
log_code.c: logformat$(BINSUF)
|
||||
./logformat
|
||||
log_header.h: log_code.c
|
||||
log_print.c log_header.h: log_code.c
|
||||
test 1 = 1
|
||||
|
||||
#Needs to be done manually since it does not include newbrt.
|
||||
|
@ -145,7 +145,7 @@ clean-tests:
|
|||
clean-local:
|
||||
rm -rf $(NEWBRT)
|
||||
rm -rf test_oexcl.c.tmp *.brt
|
||||
rm -rf log_code.c log_header.h logformat
|
||||
rm -rf log_code.c log_header.h log_print.c logformat
|
||||
|
||||
# After doing (cd ../src/tests;make test_log5.recover), run these. The files should have no differences.
|
||||
testdump: brtdump$(BINSUF)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#define _XOPEN_SOURCE 500
|
||||
#include <arpa/inet.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <zlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
|
||||
#define N 200000000
|
||||
char *buf;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <zlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#define N 200000000
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* - Obtaining it for the second one?
|
||||
* - The third one? */
|
||||
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* - Obtaining it for the second one?
|
||||
* - The third one? */
|
||||
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* The Latex documentation.
|
||||
*/
|
||||
#include <toku_portability.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
|
|
|
@ -157,13 +157,20 @@ endif
|
|||
check_benchmarktest_256: benchmark-test$(BINSUF) $(PTHREAD_LOCAL)
|
||||
$(VGRIND) ./$< $(VERBVERBOSE) --valsize 256 --verify 1 $(SUMMARIZE_CMD)
|
||||
|
||||
|
||||
check_test-assertA: test-assert$(BINSUF) $(PTHREAD_LOCAL)
|
||||
@# no arguments, should err
|
||||
$(VGRIND) ./$< > /dev/null 2>&1 ; test $$? = 1 $(SUMMARIZE_CMD)
|
||||
|
||||
ifeq ($(OS_CHOICE),windows)
|
||||
TEST_ASSERT_FAILCODE=134 #Does not use raise(SIGABRT) to fail assert, so will not overwrite 134 with 1.
|
||||
else
|
||||
TEST_ASSERT_FAILCODE=1
|
||||
endif
|
||||
check_test-assertB: test-assert$(BINSUF) $(PTHREAD_LOCAL)
|
||||
@# one argument, not "ok" should err
|
||||
@rm -f test-assert.out
|
||||
($(VGRIND) ./$< notok) > test-assert.out 2>&1 ; test $$? = 1 && fgrep failed test-assert.out > /dev/null $(SUMMARIZE_CMD)
|
||||
($(VGRIND) ./$< notok) > test-assert.out 2>&1 ; test $$? = $(TEST_ASSERT_FAILCODE) && fgrep failed test-assert.out > /dev/null $(SUMMARIZE_CMD)
|
||||
check_test-assertC: test-assert$(BINSUF) $(PTHREAD_LOCAL)
|
||||
|
||||
check_test-assert$(BINSUF): test-assert$(BINSUF) $(PTHREAD_LOCAL)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "test.h"
|
||||
#include <toku_portability.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
|
|
@ -2,10 +2,11 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <toku_assert.h>
|
||||
|
||||
|
||||
#include "test.h"
|
||||
#include "checkpoint.h"
|
||||
#include "toku_atomic.h"
|
||||
|
||||
static int N; // how many items in the table
|
||||
static CACHEFILE cf;
|
||||
|
@ -16,23 +17,14 @@ static const int item_size = sizeof(int);
|
|||
|
||||
static volatile int n_flush, n_write_me, n_keep_me, n_fetch;
|
||||
|
||||
#if TOKU_WINDOWS
|
||||
//This is NOT correct, but close enough for now.
|
||||
//Obviously has race conditions.
|
||||
static void
|
||||
__sync_fetch_and_add(volatile int *num, int incr) {
|
||||
*num += incr;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
sleep_random (void)
|
||||
{
|
||||
#if TOKU_WINDOWS
|
||||
sleep(1);
|
||||
usleep(random() % 1000); //Will turn out to be almost always 1ms.
|
||||
#else
|
||||
toku_timespec_t req = {.tv_sec = 0,
|
||||
.tv_nsec = random()%1000000};
|
||||
.tv_nsec = random()%1000000}; //Max just under 1ms
|
||||
nanosleep(&req, NULL);
|
||||
#endif
|
||||
}
|
||||
|
@ -47,9 +39,9 @@ flush (CACHEFILE UU(thiscf), CACHEKEY UU(key), void *value, void *UU(extraargs),
|
|||
int *v = value;
|
||||
if (*v!=expect_value) printf("got %d expect %d\n", *v, expect_value);
|
||||
assert(*v==expect_value);
|
||||
(void)__sync_fetch_and_add(&n_flush, 1);
|
||||
if (write_me) (void)__sync_fetch_and_add(&n_write_me, 1);
|
||||
if (keep_me) (void)__sync_fetch_and_add(&n_keep_me, 1);
|
||||
(void)toku_sync_fetch_and_add_int32(&n_flush, 1);
|
||||
if (write_me) (void)toku_sync_fetch_and_add_int32(&n_write_me, 1);
|
||||
if (keep_me) (void)toku_sync_fetch_and_add_int32(&n_keep_me, 1);
|
||||
sleep_random();
|
||||
}
|
||||
|
||||
|
@ -103,12 +95,12 @@ static int dummy_pin_unpin(CACHEFILE UU(cfu), void* UU(v)) {
|
|||
}
|
||||
|
||||
static void checkpoint_pending(void) {
|
||||
if (verbose) printf("%s:%d n=%d\n", __FUNCTION__, __LINE__, N);
|
||||
if (verbose) { printf("%s:%d n=%d\n", __FUNCTION__, __LINE__, N); fflush(stdout); }
|
||||
const int test_limit = N;
|
||||
int r;
|
||||
r = toku_create_cachetable(&ct, test_limit*sizeof(int), ZERO_LSN, NULL_LOGGER); assert(r == 0);
|
||||
char fname1[] = __FILE__ "test1.dat";
|
||||
unlink(fname1);
|
||||
r = unlink(fname1); if (r!=0) CKERR2(errno, ENOENT);
|
||||
r = toku_cachetable_openf(&cf, ct, fname1, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
|
||||
toku_cachefile_set_userdata(cf, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
dummy_pin_unpin, dummy_pin_unpin);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4 -*- */
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <toku_assert.h>
|
||||
|
||||
|
||||
#include "test.h"
|
||||
#include "checkpoint.h"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// the blocks in the reading state should be ignored.
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <toku_assert.h>
|
||||
|
||||
|
||||
#include "test.h"
|
||||
#include "checkpoint.h"
|
||||
|
|
|
@ -47,7 +47,7 @@ cachetable_reserve_filenum_test (void) {
|
|||
assert(r == ENOENT);
|
||||
|
||||
// now exercise filenum reservation
|
||||
FILENUM fn2;
|
||||
FILENUM fn2 = {0};
|
||||
r = toku_cachetable_reserve_filenum(ct, &fn, FALSE, fn2);
|
||||
CKERR(r);
|
||||
toku_cachetable_unreserve_filenum (ct, fn);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "toku_list.h"
|
||||
#include "toku_assert.h"
|
||||
|
||||
|
||||
#include "test.h"
|
||||
#include <memory.h>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "toku_assert.h"
|
||||
|
||||
#include "memory.h"
|
||||
#include "mempool.h"
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "test.h"
|
||||
#include "minicron.h"
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "omt.h"
|
||||
#include "memory.h"
|
||||
#include "toku_assert.h"
|
||||
|
||||
#include "brttypes.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include "omt.h"
|
||||
#include "memory.h"
|
||||
#include "toku_assert.h"
|
||||
|
||||
#include "brttypes.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include <toku_portability.h>
|
||||
#include "toku_assert.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <toku_portability.h>
|
||||
#include "brt.h"
|
||||
#include "toku_htonl.h"
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
|
||||
#include "test.h"
|
||||
#include <assert.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <toku_portability.h>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <malloc.h>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "toku_assert.h"
|
||||
|
||||
#include "toku_pthread.h"
|
||||
#include "memory.h"
|
||||
#include "workqueue.h"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <malloc.h>
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <tokudb.h>
|
||||
#define DIRSUF tokudb
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include "bdbw.h"
|
||||
|
||||
#define barf() ({ fprintf(stderr, "YDB: BARF %s:%d in %s\n", __FILE__, __LINE__, __func__); })
|
||||
|
|
27
src/Makefile
27
src/Makefile
|
@ -37,23 +37,31 @@ OBJS_RAW = \
|
|||
#\end
|
||||
#OBJS automatically defined.
|
||||
|
||||
LIBRARIES= \
|
||||
LIBRARIES=
|
||||
|
||||
LIBRARIES+= \
|
||||
$(LIBRARY) \
|
||||
$(LIBRARY_S) \
|
||||
#Purposely here for \ at end of prev
|
||||
ifeq ($(OS_CHOICE),windows)
|
||||
ifeq ($(DEBUG),0)
|
||||
LIBRARIES += $(IPO_YDB)
|
||||
else
|
||||
LIBRARIES += $(NOIPO_YDB)
|
||||
endif
|
||||
endif
|
||||
|
||||
INSTALL_LIBRARIES= $(patsubst %,%.install,$(LIBRARIES))
|
||||
ifeq ($(OS_CHOICE),windows)
|
||||
INSTALL_LIBRARIES += libtokudb.pdb.install
|
||||
endif
|
||||
|
||||
ifeq ($(OS_CHOICE),windows)
|
||||
#Does not support parallel builds for files in src.
|
||||
.NOTPARALLEL:;
|
||||
ifeq ($(DEBUG),0)
|
||||
WINYDB = $(IPO_YDB)
|
||||
else
|
||||
WINYDB = $(NOIPO_YDB)
|
||||
endif
|
||||
LIBRARIES += $(WINYDB)
|
||||
libtokudb.pdb : $(WINYDB);
|
||||
endif
|
||||
|
||||
|
||||
|
||||
.PHONY:install_libs install.% build install local build_tests
|
||||
|
||||
|
@ -69,9 +77,6 @@ install_libs: $(INSTALL_LIBRARIES)
|
|||
%.install: %
|
||||
if ! diff $* ../lib/$* > /dev/null 2>&1; then cp $* ../lib/; fi
|
||||
|
||||
libtokudb.pdb.install: libtokudb.pdb
|
||||
if ! diff $< ../lib/$< > /dev/null 2>&1; then cp $< ../lib/; fi
|
||||
|
||||
.PHONY: install
|
||||
install: libs install_libs ;
|
||||
|
||||
|
|
13
src/elocks.c
13
src/elocks.c
|
@ -14,14 +14,16 @@
|
|||
#include <toku_portability.h>
|
||||
#include "ydb-internal.h"
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <toku_pthread.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined(__linux__) && __linux__
|
||||
//Enabled for linux
|
||||
#define YDB_LOCK_MISS_TIME 1
|
||||
#else
|
||||
#define YDB_LOCK_MISS_TIME 0
|
||||
//Enabled for windows
|
||||
#define YDB_LOCK_MISS_TIME 1
|
||||
#endif
|
||||
|
||||
struct ydb_big_lock {
|
||||
|
@ -61,9 +63,9 @@ ydbtime_destr(void *a) {
|
|||
struct ydbtime *ydbtime = (struct ydbtime *) a;
|
||||
int r;
|
||||
// printf("%s %p\n", __FUNCTION__, a);
|
||||
r = pthread_mutex_lock(&ydb_big_lock.lock); assert(r == 0);
|
||||
r = toku_pthread_mutex_lock(&ydb_big_lock.lock); assert(r == 0);
|
||||
toku_list_remove(&ydbtime->all_ydbtimes);
|
||||
r = pthread_mutex_unlock(&ydb_big_lock.lock); assert(r == 0);
|
||||
r = toku_pthread_mutex_unlock(&ydb_big_lock.lock); assert(r == 0);
|
||||
toku_free(ydbtime);
|
||||
}
|
||||
|
||||
|
@ -123,7 +125,8 @@ toku_ydb_lock_destroy(void) {
|
|||
r = toku_pthread_key_delete(ydb_big_lock.time_key); assert(r == 0);
|
||||
while (!toku_list_empty(&ydb_big_lock.all_ydbtimes)) {
|
||||
struct toku_list *list = toku_list_pop(&ydb_big_lock.all_ydbtimes);
|
||||
ydbtime_destr(list);
|
||||
struct ydbtime *ydbtime = toku_list_struct(list, struct ydbtime, all_ydbtimes);
|
||||
ydbtime_destr(ydbtime);
|
||||
}
|
||||
#endif
|
||||
r = toku_pthread_mutex_destroy(&ydb_big_lock.lock); assert(r == 0);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include <toku_portability.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <memory.h>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include <toku_portability.h>
|
||||
#include <idlth.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include <toku_portability.h>
|
||||
#include "lth.h"
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include <toku_portability.h>
|
||||
#include "rth.h"
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <errno.h>
|
||||
int verbose=0;
|
||||
#include <db_id.h>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include <rangetree.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
struct __toku_range_tree_local {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include <rangetree.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <toku_stdint.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <toku_assert.h>
|
||||
#include <rangetree.h>
|
||||
#include <errno.h>
|
||||
#include "memory.h"
|
||||
|
|
|
@ -182,23 +182,16 @@ TDB_TESTS_THAT_SHOULD_FAIL_LIT= \
|
|||
test_log10.recover \
|
||||
recover-missing-dbfile.abortrecover \
|
||||
recover-missing-dbfile-2.abortrecover \
|
||||
recover-missing-dbfile-2.abortrecover \
|
||||
recover-dbopen-eclose.abortrecover \
|
||||
#\ ends prev line
|
||||
|
||||
ifeq ($(OS_CHOICE),windows)
|
||||
#Tests that fail in windows but shouldn't. TODO: Fix each one of these and remove from the list!
|
||||
TDB_TESTS_THAT_SHOULD_FAIL += \
|
||||
test-recover2 \
|
||||
test-recover3 \
|
||||
WIN_IGNORE_TDB_TESTS_THAT_SHOULD_FAIL += \
|
||||
#\ ends prev line
|
||||
TDB_TESTS_THAT_SHOULD_FAIL_LIT += \
|
||||
test_log4.recover \
|
||||
test_log5.recover \
|
||||
test_log7.recover \
|
||||
test_log8.recover \
|
||||
test_log9.recover \
|
||||
test_log10.recover \
|
||||
WIN_IGNORE_TDB_TESTS_THAT_SHOULD_FAIL_LIT += \
|
||||
#\ ends prev line
|
||||
#NOTE: test_log[89].recover is non-deterministic. Sometimes passes/fails
|
||||
endif
|
||||
|
||||
ALL_TESTS = $(TDB_TESTS)
|
||||
|
@ -216,7 +209,16 @@ EXTRA_TDB_TESTS = \
|
|||
$(patsubst %,test_log%.recover,$(TLRECOVER)) \
|
||||
#\ ends prev line
|
||||
|
||||
ifeq ($(OS_CHOICE),windows)
|
||||
EXTRA_TDB_TESTS = \
|
||||
$(patsubst %,test_log%.recover,$(filter-out $(patsubst %,%.c,$(WINDOWS_DONTRUN_TESTS)),$(TLRECOVER))) \
|
||||
#\ ends prev line
|
||||
endif
|
||||
|
||||
RECOVER_TESTS = $(patsubst %.c,%.abortrecover,$(RECOVER_SRCS))
|
||||
ifeq ($(OS_CHOICE),windows)
|
||||
RECOVER_TESTS = $(patsubst %.c,%.abortrecover,$(filter-out $(patsubst %,%.c,$(WINDOWS_DONTRUN_TESTS)),$(RECOVER_SRCS)))
|
||||
endif
|
||||
|
||||
RUN_TDB_TESTS = $(patsubst %.tdb$(BINSUF),%.tdbrun,$(TDB_TESTS)) $(EXTRA_TDB_TESTS) $(RECOVER_TESTS)
|
||||
RUN_BDB_TESTS = $(patsubst %.bdb$(BINSUF),%.bdbrun,$(BDB_TESTS))
|
||||
|
@ -329,10 +331,11 @@ endif
|
|||
%.recoverwc: %.tdb$(BINSUF) $(PTHREAD_LOCAL)
|
||||
(cd dir.$*.c.tdb;pwd;cat log*| ../../../newbrt/tdb_logprint |wc -c)
|
||||
|
||||
ABORTCODE=137
|
||||
%.abortrecover: %.tdb$(BINSUF) $(PTHREAD_LOCAL)
|
||||
ifeq ($(VGRIND),)
|
||||
./$< --test >$<.check.output 2>&1; \
|
||||
if [ $$? -ne 134 ] ; then \
|
||||
if [ $$? -ne $(ABORTCODE) ] ; then \
|
||||
test 0 = 1; \
|
||||
else \
|
||||
./$< --recover >>$<.check.output 2>&1; \
|
||||
|
@ -340,7 +343,7 @@ ifeq ($(VGRIND),)
|
|||
$(MAYBEINVERTER) $(SUMMARIZE_CMD)
|
||||
else
|
||||
./$< --test >$<.check.output 2>&1; \
|
||||
if [ $$? -ne 134 ] ; then \
|
||||
if [ $$? -ne $(ABORTCODE) ] ; then \
|
||||
cat $<.check.output; test 0 = 1; \
|
||||
else \
|
||||
valgrind --quiet --error-exitcode=1 --leak-check=full --log-file=$<.check.valgrind ./$< --recover >>$<.check.output 2>&1; \
|
||||
|
@ -489,6 +492,9 @@ checkpoint_stress.tdbrun: checkpoint_stress.tdb$(BINSUF) $(PTHREAD_LOCAL)
|
|||
for (( i = 1; i < $(STRESS_RUNS); i++ )); do \
|
||||
date; \
|
||||
./$< -c -i $$i -n $(STRESS_SIZE) $(VERBVERBOSE) 2> dir.checkpoint_stress.c.tdb/error.$$i ; \
|
||||
if [ $$? -ne $(ABORTCODE) ] ; then \
|
||||
exit 1 ; \
|
||||
fi ; \
|
||||
if ! grep -q 'HAPPY CRASH' dir.checkpoint_stress.c.tdb/error.$$i; then break; fi; \
|
||||
done && \
|
||||
test `grep -l 'HAPPY CRASH' dir.checkpoint_stress.c.tdb/error.* |wc -l` = $$(($(STRESS_RUNS)-1)) \
|
||||
|
@ -501,6 +507,9 @@ recover_stress.tdbrun: checkpoint_stress.tdb$(BINSUF) $(PTHREAD_LOCAL)
|
|||
for (( i = 1; i < $(STRESS_RUNS); i++ )); do \
|
||||
date; \
|
||||
./$< -c -i $$i -n $(STRESS_SIZE) -l $(VERBVERBOSE) 2> dir.checkpoint_stress.c.tdb/error.$$i ; \
|
||||
if [ $$? -ne $(ABORTCODE) ] ; then \
|
||||
exit 1 ; \
|
||||
fi ; \
|
||||
if ! grep -q 'HAPPY CRASH' dir.checkpoint_stress.c.tdb/error.$$i; then break; fi; \
|
||||
done && \
|
||||
test `grep -l 'HAPPY CRASH' dir.checkpoint_stress.c.tdb/error.* |wc -l` = $$(($(STRESS_RUNS)-1)) \
|
||||
|
@ -548,7 +557,10 @@ recovery_fileops_unit.tdbrun: recovery_fileops_unit.tdb$(BINSUF) $(PTHREAD_LOCAL
|
|||
for i in $$iset; do \
|
||||
errorfile=dir.$@.errors/crash.$$O.$$a.$$b.$$c.$$d.$$e.$$f.$$g.$$h.$$i; \
|
||||
combination="-O $$O -A $$a -B $$b -C $$c -D $$d -E $$e -F $$f -G $$g -H $$h -I $$i"; \
|
||||
./$< $(VERBVERBOSE) -c $$combination 2> $$errorfile && { cat dir.$@.errors/crash; echo Error: no crash in $$errorfile ; exit 1; }; \
|
||||
./$< $(VERBVERBOSE) -c $$combination 2> $$errorfile ; \
|
||||
if [ $$? -ne $(ABORTCODE) ] ; then \
|
||||
{ cat dir.$@.errors/crash; echo Error: no crash in $$errorfile ; exit 1; }; \
|
||||
fi ; \
|
||||
grep 'HAPPY CRASH' $$errorfile >/dev/null || { cat $$errorfile; echo Error: incorrect crash in $$errorfile ; exit 1; }; \
|
||||
./$< $(VERBVERBOSE) -r $$combination 2>> $$errorfile || { cat $$errorfile ; echo Error: during recovery in $$errorfile ; exit 1; }; \
|
||||
count=$$(($$count + 1)); \
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "checkpoint_test.h"
|
||||
|
||||
|
||||
/***
|
||||
|
||||
|
||||
|
@ -121,15 +122,7 @@ drop_dead(void) {
|
|||
fprintf(stderr, "HAPPY CRASH\n");
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
int zero = 0;
|
||||
int infinity = 1/zero;
|
||||
printf("Survived zerodivide!\n");
|
||||
fflush(stdout);
|
||||
printf("Infinity = %d\n", infinity);
|
||||
fflush(stdout);
|
||||
void * intothevoid = NULL;
|
||||
(*(int*)intothevoid)++;
|
||||
printf("intothevoid = %p, infinity = %d\n", intothevoid, infinity);
|
||||
toku_hard_crash_on_purpose();
|
||||
printf("This line should never be printed\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
|
|
@ -33,11 +33,12 @@ static void test_shutdown(void);
|
|||
static void
|
||||
setup (u_int32_t flags) {
|
||||
int r;
|
||||
system("rm -rf " ENVDIR);
|
||||
r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
|
||||
CKERR(r);
|
||||
if (env)
|
||||
test_shutdown();
|
||||
r = system("rm -rf " ENVDIR);
|
||||
CKERR(r);
|
||||
r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
|
||||
CKERR(r);
|
||||
r=db_env_create(&env, 0);
|
||||
CKERR(r);
|
||||
env->set_errfile(env, stderr);
|
||||
|
@ -69,24 +70,27 @@ reopen_env(u_int32_t flags, int expected_r) {
|
|||
static void
|
||||
delete_persistent(void) {
|
||||
char cmd[1024];
|
||||
sprintf(cmd, "rm -rf %s%s%s\n", ENVDIR, "/", "tokudb.environment");
|
||||
system(cmd);
|
||||
sprintf(cmd, "rm -rf %s%s%s", ENVDIR, "/", "tokudb.environment");
|
||||
int r = system(cmd);
|
||||
CKERR(r);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
delete_directory(void) {
|
||||
char cmd[1024];
|
||||
sprintf(cmd, "rm -rf %s%s%s\n", ENVDIR, "/", "tokudb.directory");
|
||||
system(cmd);
|
||||
sprintf(cmd, "rm -rf %s%s%s", ENVDIR, "/", "tokudb.directory");
|
||||
int r = system(cmd);
|
||||
CKERR(r);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
delete_log(void) {
|
||||
char cmd[1024];
|
||||
sprintf(cmd, "rm -rf %s%s%s\n", ENVDIR, "/", "*.tokulog");
|
||||
system(cmd);
|
||||
sprintf(cmd, "rm -rf %s%s%s", ENVDIR, "/", "*.tokulog");
|
||||
int r = system(cmd);
|
||||
CKERR(r);
|
||||
}
|
||||
|
||||
|
||||
|
@ -109,7 +113,6 @@ test_env_startup(int logging) {
|
|||
flags = FLAGS_NOLOG;
|
||||
|
||||
create_env(flags);
|
||||
reopen_env(flags, 0); // reopen existing environment
|
||||
|
||||
// delete persistent info and try to reopen
|
||||
delete_persistent();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
|
||||
#include "test.h"
|
||||
// The helgrind1.tdbrun test should fail. This is merely a check to verify that helgrind actually notices a race.
|
||||
#include <assert.h>
|
||||
|
||||
#include <pthread.h>
|
||||
int x;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "test.h"
|
||||
// The helgrind2 test performs a DB->get() in two different concurrent threads.
|
||||
#include <arpa/inet.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <db.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/stat.h>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "test.h"
|
||||
// The helgrind2 test performs a DB->get() in two different concurrent threads.
|
||||
#include <arpa/inet.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <db.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/stat.h>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
|
||||
#include "test.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <db.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
|
||||
#include "test.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <db.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
|
||||
#include "test.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <db.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
|
||||
#include "test.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <db.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
||||
char *namea="a.db";
|
||||
|
@ -35,7 +36,7 @@ static void run_test (void) {
|
|||
r = db->open(db, NULL, namea, NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666); CKERR(r);
|
||||
r = db->close(db, 0); CKERR(r);
|
||||
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (void) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
char *namea="a.db";
|
||||
char *nameb="b.db";
|
||||
|
@ -43,7 +44,7 @@ static void run_test (BOOL do_commit, BOOL do_abort) {
|
|||
r = txn->commit(txn, 0); CKERR(r);
|
||||
}
|
||||
//printf("shutdown\n");
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (BOOL did_commit) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
char *namea="a.db";
|
||||
char *nameb="b.db";
|
||||
|
@ -43,7 +44,7 @@ static void run_test (BOOL do_commit, BOOL do_abort) {
|
|||
r = txn->commit(txn, 0); CKERR(r);
|
||||
}
|
||||
//printf("shutdown\n");
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (BOOL did_commit) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
char *namea="a.db";
|
||||
char *nameb="b.db";
|
||||
|
@ -45,7 +46,7 @@ static void run_test (BOOL do_commit, BOOL do_abort) {
|
|||
r = txn->commit(txn, 0); CKERR(r);
|
||||
}
|
||||
//printf("shutdown\n");
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (BOOL did_commit) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
char *namea="a.db";
|
||||
char *nameb="b.db";
|
||||
|
@ -45,7 +46,7 @@ static void run_test (BOOL do_commit, BOOL do_abort) {
|
|||
r = txn->commit(txn, 0); CKERR(r);
|
||||
}
|
||||
//printf("shutdown\n");
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (BOOL did_commit) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
char descriptor_contents[] = "Spoon full of sugar";
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
@ -72,7 +73,7 @@ do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
|
|||
r = txn->commit(txn, 0); CKERR(r);
|
||||
}
|
||||
//printf("shutdown\n");
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
char *namea="a.db";
|
||||
char *nameb="b.db";
|
||||
|
@ -54,7 +55,7 @@ do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
|
|||
r = txn->commit(txn, 0); CKERR(r);
|
||||
}
|
||||
//printf("shutdown\n");
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -20,7 +20,7 @@ static void run_test (void) {
|
|||
r = db_create(&db, env, 0); CKERR(r);
|
||||
|
||||
r = env->close(env, 0);
|
||||
assert(r == EINVAL);
|
||||
CKERR2(r,EINVAL);
|
||||
}
|
||||
|
||||
static void run_recover (void) {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
char *namea="a.db";
|
||||
|
||||
|
@ -52,7 +53,7 @@ run_test (BOOL do_commit, BOOL do_abort) {
|
|||
r = txn->commit(txn, DB_TXN_SYNC); CKERR(r);
|
||||
}
|
||||
//printf("shutdown\n");
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
char *namea="a.db";
|
||||
|
||||
|
@ -52,7 +53,7 @@ run_test (BOOL do_commit, BOOL do_abort) {
|
|||
r = txn->commit(txn, DB_TXN_SYNC); CKERR(r);
|
||||
}
|
||||
//printf("shutdown\n");
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
||||
char *namea="a.db";
|
||||
|
@ -37,7 +38,7 @@ static void run_test (void) {
|
|||
|
||||
r = txn->commit(txn, 0); CKERR(r);
|
||||
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (void) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
||||
char *namea="a.db";
|
||||
|
@ -35,7 +36,7 @@ static void run_test (void) {
|
|||
|
||||
r = txn->commit(txn, 0); CKERR(r);
|
||||
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (void) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
||||
char *namea="a.db";
|
||||
|
@ -43,7 +44,7 @@ static void run_test (void) {
|
|||
|
||||
r = txn->commit(txn, DB_TXN_SYNC); CKERR(r);
|
||||
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (void) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
||||
char *namea="a.db";
|
||||
|
@ -27,7 +28,7 @@ static void run_test (void) {
|
|||
r = env->txn_checkpoint(env, 0, 0, 0); CKERR(r);
|
||||
r = txn->commit(txn, 0); CKERR(r);
|
||||
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (void) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
||||
char *namea="a.db";
|
||||
|
@ -36,7 +37,7 @@ static void run_test (void) {
|
|||
|
||||
r = txn->commit(txn, 0); CKERR(r);
|
||||
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (void) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
||||
char *namea="a.db";
|
||||
|
@ -23,7 +24,7 @@ static void run_test (void) {
|
|||
r = db_create(&db, env, 0); CKERR(r);
|
||||
r = db->open(db, txn, namea, NULL, DB_BTREE, DB_CREATE, 0666); CKERR(r);
|
||||
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (void) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
||||
char *namea="a.db";
|
||||
|
@ -39,7 +40,7 @@ static void run_test (void) {
|
|||
|
||||
r = txn->commit(txn, DB_TXN_SYNC); CKERR(r);
|
||||
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (void) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
||||
char *namea="a.db";
|
||||
|
@ -39,7 +40,7 @@ static void run_test (void) {
|
|||
|
||||
r = txn->commit(txn, DB_TXN_SYNC); CKERR(r);
|
||||
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (void) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
||||
char *namea="a.db";
|
||||
|
@ -66,7 +67,7 @@ static void run_test (void) {
|
|||
|
||||
r = db->close(db, 0); CKERR(r);
|
||||
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (void) {
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <fcntl.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
||||
char *namea="a.db";
|
||||
|
@ -51,7 +52,7 @@ static void run_test (void) {
|
|||
r = env->txn_checkpoint(env, 0, 0, 0); CKERR(r);
|
||||
|
||||
// abort the process
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
||||
#define NAMEA "a.db"
|
||||
|
@ -50,7 +51,7 @@ static void run_test (void) {
|
|||
|
||||
r = txn->commit(txn, 0); CKERR(r);
|
||||
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (void) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
||||
#define NAMEA "a.db"
|
||||
|
@ -40,7 +41,7 @@ static void run_test (void) {
|
|||
|
||||
r = txn->commit(txn, 0); CKERR(r);
|
||||
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (void) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
||||
char *namea="a.db";
|
||||
|
@ -49,7 +50,7 @@ static void run_test (void) {
|
|||
|
||||
r = txn->commit(txn, 0); CKERR(r);
|
||||
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (void) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
||||
char *namea="a.db";
|
||||
|
@ -40,7 +41,7 @@ static void run_test (void) {
|
|||
r = env->txn_checkpoint(env, 0, 0, 0); CKERR(r);
|
||||
|
||||
// abort the process
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (void) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
|
||||
char *namea="a.db";
|
||||
|
@ -43,7 +44,7 @@ static void run_test (void) {
|
|||
r = env->txn_checkpoint(env, 0, 0, 0); CKERR(r);
|
||||
|
||||
// abort the process
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void run_recover (void) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
|
||||
char *namea="a.db";
|
||||
|
||||
|
@ -41,7 +42,7 @@ do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
|
|||
r = txn->commit(txn, 0); CKERR(r);
|
||||
}
|
||||
//printf("shutdown\n");
|
||||
abort();
|
||||
toku_hard_crash_on_purpose();
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue