summaryrefslogtreecommitdiff
path: root/storage/tokudb/ft-index/src
diff options
context:
space:
mode:
Diffstat (limited to 'storage/tokudb/ft-index/src')
-rw-r--r--storage/tokudb/ft-index/src/errors.cc2
-rw-r--r--storage/tokudb/ft-index/src/indexer-undo-do.cc2
-rw-r--r--storage/tokudb/ft-index/src/indexer.cc2
-rw-r--r--storage/tokudb/ft-index/src/loader.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/CMakeLists.txt1
-rw-r--r--storage/tokudb/ft-index/src/tests/helgrind.suppressions22
-rw-r--r--storage/tokudb/ft-index/src/tests/test_insert_unique.cc15
-rw-r--r--storage/tokudb/ft-index/src/tests/test_keylen_diff.cc26
-rw-r--r--storage/tokudb/ft-index/src/ydb.cc2
-rw-r--r--storage/tokudb/ft-index/src/ydb_cursor.cc2
-rw-r--r--storage/tokudb/ft-index/src/ydb_db.cc2
-rw-r--r--storage/tokudb/ft-index/src/ydb_env_func.cc2
-rw-r--r--storage/tokudb/ft-index/src/ydb_row_lock.cc2
-rw-r--r--storage/tokudb/ft-index/src/ydb_txn.cc1
-rw-r--r--storage/tokudb/ft-index/src/ydb_write.cc2
15 files changed, 67 insertions, 18 deletions
diff --git a/storage/tokudb/ft-index/src/errors.cc b/storage/tokudb/ft-index/src/errors.cc
index fa1227b25cc..6c330f040dd 100644
--- a/storage/tokudb/ft-index/src/errors.cc
+++ b/storage/tokudb/ft-index/src/errors.cc
@@ -96,6 +96,8 @@ PATENT RIGHTS GRANT:
The error handling routines for ydb
*/
+#include <config.h>
+
#include <toku_portability.h>
#include <stdio.h>
#include <stdarg.h>
diff --git a/storage/tokudb/ft-index/src/indexer-undo-do.cc b/storage/tokudb/ft-index/src/indexer-undo-do.cc
index 52489fb7825..03e05751358 100644
--- a/storage/tokudb/ft-index/src/indexer-undo-do.cc
+++ b/storage/tokudb/ft-index/src/indexer-undo-do.cc
@@ -89,6 +89,8 @@ PATENT RIGHTS GRANT:
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#ident "$Id$"
+#include <config.h>
+
#include <toku_portability.h>
#include <toku_assert.h>
diff --git a/storage/tokudb/ft-index/src/indexer.cc b/storage/tokudb/ft-index/src/indexer.cc
index aa821f67fba..ebb2607483a 100644
--- a/storage/tokudb/ft-index/src/indexer.cc
+++ b/storage/tokudb/ft-index/src/indexer.cc
@@ -92,6 +92,8 @@ PATENT RIGHTS GRANT:
/*
* The indexer
*/
+#include <config.h>
+
#include <stdio.h>
#include <string.h>
#include <toku_portability.h>
diff --git a/storage/tokudb/ft-index/src/loader.cc b/storage/tokudb/ft-index/src/loader.cc
index 1a6bf718443..0a742dff6d1 100644
--- a/storage/tokudb/ft-index/src/loader.cc
+++ b/storage/tokudb/ft-index/src/loader.cc
@@ -93,6 +93,8 @@ PATENT RIGHTS GRANT:
* The loader
*/
+#include <config.h>
+
#include <toku_portability.h>
#include <portability/toku_atomic.h>
#include <stdio.h>
diff --git a/storage/tokudb/ft-index/src/tests/CMakeLists.txt b/storage/tokudb/ft-index/src/tests/CMakeLists.txt
index 06f7e523746..228c91136cd 100644
--- a/storage/tokudb/ft-index/src/tests/CMakeLists.txt
+++ b/storage/tokudb/ft-index/src/tests/CMakeLists.txt
@@ -486,6 +486,7 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
ydb/loader-stress-test4z.tdb
ydb/recover_stress.tdb
ydb/test3529.tdb
+ ydb/test_insert_unique.tdb
)
set_tests_properties(${phenomenally_long_tests} PROPERTIES TIMEOUT 14400)
endif(BUILD_TESTING OR BUILD_SRC_TESTS)
diff --git a/storage/tokudb/ft-index/src/tests/helgrind.suppressions b/storage/tokudb/ft-index/src/tests/helgrind.suppressions
index 84d316d06d5..524739387ce 100644
--- a/storage/tokudb/ft-index/src/tests/helgrind.suppressions
+++ b/storage/tokudb/ft-index/src/tests/helgrind.suppressions
@@ -123,4 +123,24 @@
fun:pthread_cond_destroy@*
...
fun:_ZN7evictor7destroyEv
-} \ No newline at end of file
+}
+{
+ <helgrind_doesnt_understand_the_way_the_world_works_and_ignores_our_disable_checking_instructions>
+ Helgrind:Race
+ fun:_ZN4toku8locktree15sto_try_acquireEPvmPK10__toku_dbtS4_
+ fun:_ZN4toku8locktree12acquire_lockEbmPK10__toku_dbtS3_PNS_9txnid_setE
+ fun:_ZN4toku8locktree16try_acquire_lockEbmPK10__toku_dbtS3_PNS_9txnid_setEb
+ fun:_ZN4toku8locktree18acquire_write_lockEmPK10__toku_dbtS3_PNS_9txnid_setEb
+ fun:_ZN4toku12lock_request5startEv
+ ...
+}
+{
+ <helgrind_bug_323432_see_http://permalink.gmane.org/gmane.comp.debugging.valgrind/13325>
+ Helgrind:Race
+ obj:/usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so
+ fun:pthread_mutex_destroy
+ fun:toku_mutex_destroy
+ fun:_ZN4toku8treenode4freeEPS0_
+ fun:_ZN4toku8treenode22remove_root_of_subtreeEv
+ ...
+}
diff --git a/storage/tokudb/ft-index/src/tests/test_insert_unique.cc b/storage/tokudb/ft-index/src/tests/test_insert_unique.cc
index 84d1ded6db5..e38ae892a67 100644
--- a/storage/tokudb/ft-index/src/tests/test_insert_unique.cc
+++ b/storage/tokudb/ft-index/src/tests/test_insert_unique.cc
@@ -133,7 +133,7 @@ static void test_large_sequential_insert_unique(DB_ENV *env) {
r = db->set_readpagesize(db, 2 * 1024); CKERR(r);
r = db->open(db, NULL, "db", NULL, DB_BTREE, DB_CREATE, 0644); CKERR(r);
- const int val_size = 1024;
+ const int val_size = 8;
char *XMALLOC_N(val_size, val_buf);
memset(val_buf, 'k', val_size);
DBT val;
@@ -153,9 +153,18 @@ static void test_large_sequential_insert_unique(DB_ENV *env) {
// .. but re-inserting is okay, if we provisionally deleted the row
DB_TXN *txn;
r = env->txn_begin(env, NULL, &txn, 0); CKERR(r);
- r = db->del(db, NULL, &key, DB_DELETE_ANY); CKERR(r);
- r = db->put(db, NULL, &key, &val, DB_NOOVERWRITE); CKERR(r);
+ r = db->del(db, txn, &key, DB_DELETE_ANY); CKERR(r);
+ r = db->put(db, txn, &key, &val, DB_NOOVERWRITE); CKERR(r);
r = txn->commit(txn, 0); CKERR(r);
+
+ // re-inserting is also ok if we actually delete the row, for some key < k
+ if (i > 0) {
+ DBT other_key;
+ int other_k = toku_htonl(i - 10);
+ dbt_init(&other_key, &other_k, sizeof(other_k));
+ r = db->del(db, NULL, &other_key, DB_DELETE_ANY); CKERR(r);
+ r = db->put(db, NULL, &other_key, &val, DB_NOOVERWRITE); CKERR(r);
+ }
}
if (i > 0 && i % 250 == 0) {
// sanity check - unique checks on random keys we already inserted should
diff --git a/storage/tokudb/ft-index/src/tests/test_keylen_diff.cc b/storage/tokudb/ft-index/src/tests/test_keylen_diff.cc
index 144ac5fce3e..d37c03db566 100644
--- a/storage/tokudb/ft-index/src/tests/test_keylen_diff.cc
+++ b/storage/tokudb/ft-index/src/tests/test_keylen_diff.cc
@@ -138,15 +138,12 @@ static int update_callback(DB *UU(db), const DBT *UU(key), const DBT *old_val, c
void (*set_val)(const DBT *new_val, void *setval_extra), void *setval_extra) {
assert(extra != nullptr);
assert(old_val != nullptr);
- assert(extra->size == 0);
- assert(old_val->size == 0);
+ assert(extra->size == 0 || extra->size == 100);
+ assert(old_val->size == 0 || old_val->size == 100);
if (extra->data == nullptr) {
set_val(nullptr, setval_extra);
} else {
- DBT new_val;
- char empty_v;
- dbt_init(&new_val, &empty_v, 0);
- set_val(&new_val, setval_extra);
+ set_val(extra, setval_extra);
}
return 0;
}
@@ -176,12 +173,13 @@ static void test_keylen_diff(enum overwrite_method method, bool control_test) {
r = db->set_readpagesize(db, 1 * 1024); // smaller basements so we get more per leaf
r = db->open(db, nullptr, "db", nullptr, DB_BTREE, DB_CREATE, 0666); CKERR(r);
- DBT null_dbt, empty_dbt;
- char empty_v;
- dbt_init(&empty_dbt, &empty_v, 0);
+ DBT null_dbt, val_dbt;
+ char val_buf[100];
+ memset(val_buf, 0, sizeof val_buf);
+ dbt_init(&val_dbt, &val_buf, sizeof val_buf);
dbt_init(&null_dbt, nullptr, 0);
- const int num_keys = 256 * 1000;
+ const int num_keys = 1<<11; //256 * 1000;
for (int i = 0; i < num_keys; i++) {
// insert it using a 4 byte key ..
@@ -189,7 +187,7 @@ static void test_keylen_diff(enum overwrite_method method, bool control_test) {
DBT dbt;
dbt_init(&dbt, &key, key.size());
- r = db->put(db, nullptr, &dbt, &empty_dbt, 0); CKERR(r);
+ r = db->put(db, nullptr, &dbt, &val_dbt, 0); CKERR(r);
}
// overwrite keys randomly, so we induce flushes and get better / realistic coverage
@@ -217,7 +215,7 @@ static void test_keylen_diff(enum overwrite_method method, bool control_test) {
env->txn_begin(env, nullptr, &txn, DB_TXN_NOSYNC); CKERR(r);
switch (method) {
case VIA_INSERT: {
- r = db->put(db, txn, &dbt, &empty_dbt, 0); CKERR(r);
+ r = db->put(db, txn, &dbt, &val_dbt, 0); CKERR(r);
break;
}
case VIA_DELETE: {
@@ -228,12 +226,12 @@ static void test_keylen_diff(enum overwrite_method method, bool control_test) {
}
case VIA_UPDATE_OVERWRITE:
case VIA_UPDATE_DELETE: {
- r = db->update(db, txn, &dbt, method == VIA_UPDATE_DELETE ? &null_dbt : &empty_dbt, 0); CKERR(r);
+ r = db->update(db, txn, &dbt, method == VIA_UPDATE_DELETE ? &null_dbt : &val_dbt, 0); CKERR(r);
break;
}
case VIA_UPDATE_OVERWRITE_BROADCAST:
case VIA_UPDATE_DELETE_BROADCAST: {
- r = db->update_broadcast(db, txn, method == VIA_UPDATE_DELETE_BROADCAST ? &null_dbt : &empty_dbt, 0); CKERR(r);
+ r = db->update_broadcast(db, txn, method == VIA_UPDATE_DELETE_BROADCAST ? &null_dbt : &val_dbt, 0); CKERR(r);
if (i > 1 ) { // only need to test broadcast twice - one with abort, one without
txn->abort(txn); // we opened a txn so we should abort it before exiting
goto done;
diff --git a/storage/tokudb/ft-index/src/ydb.cc b/storage/tokudb/ft-index/src/ydb.cc
index e61bf940175..85445a67eef 100644
--- a/storage/tokudb/ft-index/src/ydb.cc
+++ b/storage/tokudb/ft-index/src/ydb.cc
@@ -92,6 +92,8 @@ PATENT RIGHTS GRANT:
extern const char *toku_patent_string;
const char *toku_copyright_string = "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved.";
+#include <config.h>
+
#include <db.h>
#include <errno.h>
#include <string.h>
diff --git a/storage/tokudb/ft-index/src/ydb_cursor.cc b/storage/tokudb/ft-index/src/ydb_cursor.cc
index c42e2fb673e..57f3b5808b6 100644
--- a/storage/tokudb/ft-index/src/ydb_cursor.cc
+++ b/storage/tokudb/ft-index/src/ydb_cursor.cc
@@ -89,6 +89,8 @@ PATENT RIGHTS GRANT:
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#ident "$Id$"
+#include <config.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/storage/tokudb/ft-index/src/ydb_db.cc b/storage/tokudb/ft-index/src/ydb_db.cc
index 2c54a3bd4dc..57f28b33d69 100644
--- a/storage/tokudb/ft-index/src/ydb_db.cc
+++ b/storage/tokudb/ft-index/src/ydb_db.cc
@@ -89,6 +89,8 @@ PATENT RIGHTS GRANT:
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#ident "$Id$"
+#include <config.h>
+
#include <ctype.h>
#include <db.h>
diff --git a/storage/tokudb/ft-index/src/ydb_env_func.cc b/storage/tokudb/ft-index/src/ydb_env_func.cc
index 714fad74ec5..e7a1a31fcce 100644
--- a/storage/tokudb/ft-index/src/ydb_env_func.cc
+++ b/storage/tokudb/ft-index/src/ydb_env_func.cc
@@ -89,6 +89,8 @@ PATENT RIGHTS GRANT:
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#ident "$Id$"
+#include <config.h>
+
#include <toku_portability.h>
#include <memory.h>
diff --git a/storage/tokudb/ft-index/src/ydb_row_lock.cc b/storage/tokudb/ft-index/src/ydb_row_lock.cc
index 40cafd0e331..5ca853d92d9 100644
--- a/storage/tokudb/ft-index/src/ydb_row_lock.cc
+++ b/storage/tokudb/ft-index/src/ydb_row_lock.cc
@@ -89,6 +89,8 @@ PATENT RIGHTS GRANT:
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#ident "$Id$"
+#include <config.h>
+
#include <db.h>
#include <locktree/lock_request.h>
diff --git a/storage/tokudb/ft-index/src/ydb_txn.cc b/storage/tokudb/ft-index/src/ydb_txn.cc
index b6b8e154c6f..dd428c4d502 100644
--- a/storage/tokudb/ft-index/src/ydb_txn.cc
+++ b/storage/tokudb/ft-index/src/ydb_txn.cc
@@ -89,6 +89,7 @@ PATENT RIGHTS GRANT:
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#ident "$Id$"
+#include <config.h>
#include <db.h>
diff --git a/storage/tokudb/ft-index/src/ydb_write.cc b/storage/tokudb/ft-index/src/ydb_write.cc
index 77daf4e6793..b6d9ac6b338 100644
--- a/storage/tokudb/ft-index/src/ydb_write.cc
+++ b/storage/tokudb/ft-index/src/ydb_write.cc
@@ -89,6 +89,8 @@ PATENT RIGHTS GRANT:
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#ident "$Id$"
+#include <config.h>
+
#include <db.h>
#include "ydb-internal.h"
#include "indexer.h"