Commit e9e22dd4 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

fix some recovery tests close[t:2005] close[t:2010]

git-svn-id: file:///svn/toku/tokudb@14546 c7de825b-a66e-492c-adef-691d508d4ae1
parent ed6f49cf
...@@ -40,16 +40,16 @@ check: $(TARGETS) $(RUNTARGETS); ...@@ -40,16 +40,16 @@ check: $(TARGETS) $(RUNTARGETS);
ifeq ($(VGRIND),) ifeq ($(VGRIND),)
./$< $(SUMMARIZE_CMD) ./$< $(SUMMARIZE_CMD)
else else
$(VGRIND) --error-exitcode=1 --quiet --leak-check=full --log-file=$<.check.valgrind ./$<; \ $(VGRIND) --error-exitcode=1 --quiet --leak-check=full --log-file=$<.check.valgrind ./$< >$<.check.output 2>&1; \
if [ $$? = 0 ] ; then \ if [ $$? = 0 ] ; then \
lines=`cat $<.check.valgrind | wc -l`; \ lines=`cat $<.check.valgrind | wc -l`; \
if [ $$lines -ne 0 ] ; then cat $<.check.valgrind; test 0 = 1; fi \ if [ $$lines -ne 0 ] ; then cat $<.check.valgrind; test 0 = 1; fi \
else \ else \
test 0 = 1; \ cat $<.check.valgrind; test 0 = 1; \
fi \ fi \
$(SUMMARIZE_CMD) $(SUMMARIZE_CMD)
endif endif
clean: clean:
rm -rf $(TARGETS) *.check.valgrind pwrite4g.data testdir rm -rf $(TARGETS) *.check.output *.check.valgrind pwrite4g.data testdir
...@@ -2593,10 +2593,10 @@ toku_brt_broadcast_commit_all (BRT brt) ...@@ -2593,10 +2593,10 @@ toku_brt_broadcast_commit_all (BRT brt)
// Effect: Insert the key-val pair into brt. // Effect: Insert the key-val pair into brt.
int toku_brt_insert (BRT brt, DBT *key, DBT *val, TOKUTXN txn) { int toku_brt_insert (BRT brt, DBT *key, DBT *val, TOKUTXN txn) {
return toku_brt_maybe_insert(brt, key, val, txn, ZERO_LSN); return toku_brt_maybe_insert(brt, key, val, txn, FALSE, ZERO_LSN);
} }
int toku_brt_maybe_insert (BRT brt, DBT *key, DBT *val, TOKUTXN txn, LSN oplsn) { int toku_brt_maybe_insert (BRT brt, DBT *key, DBT *val, TOKUTXN txn, BOOL oplsn_valid, LSN oplsn) {
int r = 0; int r = 0;
XIDS message_xids; XIDS message_xids;
TXNID xid = toku_txn_get_txnid(txn); TXNID xid = toku_txn_get_txnid(txn);
...@@ -2628,7 +2628,7 @@ int toku_brt_maybe_insert (BRT brt, DBT *key, DBT *val, TOKUTXN txn, LSN oplsn) ...@@ -2628,7 +2628,7 @@ int toku_brt_maybe_insert (BRT brt, DBT *key, DBT *val, TOKUTXN txn, LSN oplsn)
} }
LSN treelsn = toku_brt_checkpoint_lsn(brt); LSN treelsn = toku_brt_checkpoint_lsn(brt);
if (oplsn.lsn != 0 && oplsn.lsn <= treelsn.lsn) { if (oplsn_valid && oplsn.lsn <= treelsn.lsn) {
r = 0; r = 0;
} else { } else {
BRT_MSG_S brtcmd = { BRT_INSERT, message_xids, .u.id={key,val}}; BRT_MSG_S brtcmd = { BRT_INSERT, message_xids, .u.id={key,val}};
...@@ -2638,10 +2638,10 @@ int toku_brt_maybe_insert (BRT brt, DBT *key, DBT *val, TOKUTXN txn, LSN oplsn) ...@@ -2638,10 +2638,10 @@ int toku_brt_maybe_insert (BRT brt, DBT *key, DBT *val, TOKUTXN txn, LSN oplsn)
} }
int toku_brt_delete(BRT brt, DBT *key, TOKUTXN txn) { int toku_brt_delete(BRT brt, DBT *key, TOKUTXN txn) {
return toku_brt_maybe_delete(brt, key, txn, ZERO_LSN); return toku_brt_maybe_delete(brt, key, txn, FALSE, ZERO_LSN);
} }
int toku_brt_maybe_delete(BRT brt, DBT *key, TOKUTXN txn, LSN oplsn) { int toku_brt_maybe_delete(BRT brt, DBT *key, TOKUTXN txn, BOOL oplsn_valid, LSN oplsn) {
int r; int r;
XIDS message_xids; XIDS message_xids;
TXNID xid = toku_txn_get_txnid(txn); TXNID xid = toku_txn_get_txnid(txn);
...@@ -2666,7 +2666,7 @@ int toku_brt_maybe_delete(BRT brt, DBT *key, TOKUTXN txn, LSN oplsn) { ...@@ -2666,7 +2666,7 @@ int toku_brt_maybe_delete(BRT brt, DBT *key, TOKUTXN txn, LSN oplsn) {
} }
LSN treelsn = toku_brt_checkpoint_lsn(brt); LSN treelsn = toku_brt_checkpoint_lsn(brt);
if (oplsn.lsn != 0 && oplsn.lsn <= treelsn.lsn) { if (oplsn_valid && oplsn.lsn <= treelsn.lsn) {
r = 0; r = 0;
} else { } else {
DBT val; DBT val;
...@@ -4531,10 +4531,10 @@ toku_brt_lookup (BRT brt, DBT *k, DBT *v, BRT_GET_CALLBACK_FUNCTION getf, void * ...@@ -4531,10 +4531,10 @@ toku_brt_lookup (BRT brt, DBT *k, DBT *v, BRT_GET_CALLBACK_FUNCTION getf, void *
/* ********************************* delete **************************************/ /* ********************************* delete **************************************/
int toku_brt_delete_both(BRT brt, DBT *key, DBT *val, TOKUTXN txn) { int toku_brt_delete_both(BRT brt, DBT *key, DBT *val, TOKUTXN txn) {
return toku_brt_maybe_delete_both(brt, key, val, txn, ZERO_LSN); return toku_brt_maybe_delete_both(brt, key, val, txn, FALSE, ZERO_LSN);
} }
int toku_brt_maybe_delete_both(BRT brt, DBT *key, DBT *val, TOKUTXN txn, LSN oplsn) { int toku_brt_maybe_delete_both(BRT brt, DBT *key, DBT *val, TOKUTXN txn, BOOL oplsn_valid, LSN oplsn) {
//{ unsigned i; printf("del %p keylen=%d key={", brt->db, key->size); for(i=0; i<key->size; i++) printf("%d,", ((char*)key->data)[i]); printf("} datalen=%d data={", val->size); for(i=0; i<val->size; i++) printf("%d,", ((char*)val->data)[i]); printf("}\n"); } //{ unsigned i; printf("del %p keylen=%d key={", brt->db, key->size); for(i=0; i<key->size; i++) printf("%d,", ((char*)key->data)[i]); printf("} datalen=%d data={", val->size); for(i=0; i<val->size; i++) printf("%d,", ((char*)val->data)[i]); printf("}\n"); }
int r; int r;
XIDS message_xids; XIDS message_xids;
...@@ -4562,7 +4562,7 @@ int toku_brt_maybe_delete_both(BRT brt, DBT *key, DBT *val, TOKUTXN txn, LSN opl ...@@ -4562,7 +4562,7 @@ int toku_brt_maybe_delete_both(BRT brt, DBT *key, DBT *val, TOKUTXN txn, LSN opl
} }
LSN treelsn = toku_brt_checkpoint_lsn(brt); LSN treelsn = toku_brt_checkpoint_lsn(brt);
if (oplsn.lsn != 0 && oplsn.lsn <= treelsn.lsn) { if (oplsn_valid && oplsn.lsn <= treelsn.lsn) {
r = 0; r = 0;
} else { } else {
BRT_MSG_S brtcmd = { BRT_DELETE_BOTH, message_xids, .u.id={key,val}}; BRT_MSG_S brtcmd = { BRT_DELETE_BOTH, message_xids, .u.id={key,val}};
......
...@@ -61,7 +61,7 @@ int toku_brt_insert (BRT brt, DBT *k, DBT *v, TOKUTXN txn); ...@@ -61,7 +61,7 @@ int toku_brt_insert (BRT brt, DBT *k, DBT *v, TOKUTXN txn);
// Effect: Insert a key and data pair into a brt if the oplsn is newer than the brt lsn. This function is called during recovery. // Effect: Insert a key and data pair into a brt if the oplsn is newer than the brt lsn. This function is called during recovery.
// Returns 0 if successful // Returns 0 if successful
int toku_brt_maybe_insert (BRT brt, DBT *k, DBT *v, TOKUTXN txn, LSN oplsn); int toku_brt_maybe_insert (BRT brt, DBT *k, DBT *v, TOKUTXN txn, BOOL oplsn_valid, LSN oplsn);
// Effect: Delete a key from a brt // Effect: Delete a key from a brt
// Returns 0 if successful // Returns 0 if successful
...@@ -69,7 +69,7 @@ int toku_brt_delete (BRT brt, DBT *k, TOKUTXN txn); ...@@ -69,7 +69,7 @@ int toku_brt_delete (BRT brt, DBT *k, TOKUTXN txn);
// Effect: Delete a key from a brt if the oplsn is newer than the brt lsn. This function is called during recovery. // Effect: Delete a key from a brt if the oplsn is newer than the brt lsn. This function is called during recovery.
// Returns 0 if successful // Returns 0 if successful
int toku_brt_maybe_delete (BRT brt, DBT *k, TOKUTXN txn, LSN oplsn); int toku_brt_maybe_delete (BRT brt, DBT *k, TOKUTXN txn, BOOL oplsn_valid, LSN oplsn);
// Effect: Delete a pair only if both k and v are equal according to the comparison function. // Effect: Delete a pair only if both k and v are equal according to the comparison function.
// Returns 0 if successful // Returns 0 if successful
...@@ -78,7 +78,7 @@ int toku_brt_delete_both (BRT brt, DBT *k, DBT *v, TOKUTXN txn); ...@@ -78,7 +78,7 @@ int toku_brt_delete_both (BRT brt, DBT *k, DBT *v, TOKUTXN txn);
// Effect: Delete a pair only if both k and v are equal according to the comparison function and the // Effect: Delete a pair only if both k and v are equal according to the comparison function and the
// oplsn is newer than the brt lsn. This function is called by recovery. // oplsn is newer than the brt lsn. This function is called by recovery.
// Returns 0 if successful // Returns 0 if successful
int toku_brt_maybe_delete_both (BRT brt, DBT *k, DBT *v, TOKUTXN txn, LSN oplsn); int toku_brt_maybe_delete_both (BRT brt, DBT *k, DBT *v, TOKUTXN txn, BOOL oplsn_valid, LSN oplsn);
int toku_brt_db_delay_closed (BRT brt, DB* db, int (*close_db)(DB*, u_int32_t), u_int32_t close_flags); int toku_brt_db_delay_closed (BRT brt, DB* db, int (*close_db)(DB*, u_int32_t), u_int32_t close_flags);
int toku_close_brt (BRT, TOKULOGGER, char **error_string); int toku_close_brt (BRT, TOKULOGGER, char **error_string);
......
This diff is collapsed.
...@@ -169,7 +169,7 @@ else ...@@ -169,7 +169,7 @@ else
lines=`cat $<.check.valgrind | wc -l`; \ lines=`cat $<.check.valgrind | wc -l`; \
if [ $$lines -ne 0 ] ; then cat $<.check.valgrind; test 0 = 1; fi \ if [ $$lines -ne 0 ] ; then cat $<.check.valgrind; test 0 = 1; fi \
else \ else \
test 0 = 1; \ cat $<.check.valgrind; test 0 = 1; \
fi \ fi \
$(SUMMARIZE_CMD) $(SUMMARIZE_CMD)
endif endif
......
...@@ -316,14 +316,14 @@ ifeq ($(VGRIND),) ...@@ -316,14 +316,14 @@ ifeq ($(VGRIND),)
else else
./$< --test >$<.check.output 2>&1; \ ./$< --test >$<.check.output 2>&1; \
if [ $$? -ne 134 ] ; then \ if [ $$? -ne 134 ] ; then \
test 0 = 1; \ cat $<.check.output; test 0 = 1; \
else \ else \
valgrind --quiet --error-exitcode=1 --leak-check=full --log-file=$<.check.valgrind ./$< --recover >>$<.check.output 2>&1; \ valgrind --quiet --error-exitcode=1 --leak-check=full --log-file=$<.check.valgrind ./$< --recover >>$<.check.output 2>&1; \
if [ $$? -ne 0 ] ; then \ if [ $$? -ne 0 ] ; then \
test 0 = 1; \ cat $<.check.valgrind; test 0 = 1; \
else \ else \
lines=`cat $<.check.valgrind | wc -l`; \ lines=`cat $<.check.valgrind | wc -l`; \
if [ $$lines -ne 0 ] ; then test 0 = 1; fi; \ if [ $$lines -ne 0 ] ; then cat $<.check.valgrind; test 0 = 1; fi; \
fi \ fi \
fi \ fi \
$(MAYBEINVERTER) $(SUMMARIZE_CMD) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
......
...@@ -70,7 +70,7 @@ test_db_thread (void) { ...@@ -70,7 +70,7 @@ test_db_thread (void) {
DB_ENV *env; DB_ENV *env;
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
r = env->open(env, ".", DB_CREATE+DB_PRIVATE+DB_INIT_MPOOL, 0); assert(r == 0); r = env->open(env, ".", DB_CREATE+DB_PRIVATE+DB_INIT_MPOOL+DB_THREAD, 0); assert(r == 0);
DB *db; DB *db;
r = db_create(&db, env, 0); assert(r == 0); r = db_create(&db, env, 0); assert(r == 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment