Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bdb/serializable.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,12 @@ static int osql_serial_check(bdb_state_type *bdb_state, void *ranges,
/* find the next valid commit (prev_lsn of DB___txn_regop points to
* DB_llog_ltran_commit) */
while (1) {
if (bdb_lock_desired(bdb_state)) {
logmsg(LOGMSG_ERROR, "bdb-lock desired, halting serial check\n");
logmsg(LOGMSG_ERROR, "@ file: %d, offset %d\n", seriallsn.file, seriallsn.offset);
rc = -99;
goto done;
}
if (logdta.data) {
free(logdta.data);
logdta.data = NULL;
Expand Down
26 changes: 17 additions & 9 deletions db/sqloffload.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,24 +223,32 @@ static int rese_commit(struct sqlclntstate *clnt, struct sql_thread *thd,
int sentops = 0;
int bdberr = 0;
int rc = 0;
int serial_rc = 0;
int usedb_only = 0;
int force_master = gbl_serialize_reads_like_writes;
bdb_state_type *bdb_state = thedb->bdb_env;

/* get_rep_gen & serial_check call into berkley */
BDB_READLOCK("rese_commit");

if (gbl_early_verify && !clnt->early_retry && gbl_osql_send_startgen &&
clnt->start_gen) {
if (clnt->start_gen != bdb_get_rep_gen(thedb->bdb_env))
clnt->early_retry = EARLY_ERR_GENCHANGE;
}
if (clnt->selectv_arr)
if (clnt->early_retry == 0 && clnt->selectv_arr) {
currangearr_build_hash(clnt->selectv_arr);
if (clnt->selectv_arr &&
bdb_osql_serial_check(thedb->bdb_env, clnt->selectv_arr,
if ((serial_rc = bdb_osql_serial_check(thedb->bdb_env, clnt->selectv_arr,
&(clnt->selectv_arr->file),
&(clnt->selectv_arr->offset), 0)) {
clnt->osql.xerr.errval = ERR_CONSTR;
errstat_cat_str(&(clnt->osql.xerr), "selectv constraints");
rc = SQLITE_ABORT;
} else if (clnt->early_retry == EARLY_ERR_VERIFY) {
&(clnt->selectv_arr->offset), 0)) != 0) {
clnt->early_retry = (serial_rc == -99) ? EARLY_ERR_GENCHANGE :
EARLY_ERR_SELECTV;
}
}

BDB_RELLOCK();

if (clnt->early_retry == EARLY_ERR_VERIFY) {
if (clnt->dbtran.mode == TRANLEVEL_SERIAL) {
clnt->osql.xerr.errval = ERR_NOTSERIAL;
errstat_cat_str(&(clnt->osql.xerr),
Expand All @@ -253,7 +261,7 @@ static int rese_commit(struct sqlclntstate *clnt, struct sql_thread *thd,
rc = SQLITE_ABORT;
} else if (clnt->early_retry == EARLY_ERR_SELECTV) {
clnt->osql.xerr.errval = ERR_CONSTR;
errstat_cat_str(&(clnt->osql.xerr), "constraints error, no genid");
errstat_cat_str(&(clnt->osql.xerr), "constraints error");
rc = SQLITE_ABORT;
} else if (clnt->early_retry == EARLY_ERR_GENCHANGE) {
clnt->osql.xerr.errval = ERR_BLOCK_FAILED + ERR_VERIFY;
Expand Down
11 changes: 0 additions & 11 deletions tests/TODO
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,6 @@ sc_resume
DISABLED TESTS:
async_sc_bench.test -- benchmark for paper
halt_processor_tds.test -- requires a cluster
jepsen_a6.test -- jepsen tests require java & root access
jepsen_a6_nemesis.test
jepsen_atomic_writes.test
jepsen_bank_nemesis.test
jepsen_bank.test
jepsen_dirty_reads.test
jepsen_g2.test
jepsen_register_nemesis.test
jepsen_register.test
jepsen_sets_nemesis.test
jepsen_sets.test
killcluster.test
netloss.test -- does not pass most of the time; requires kernel 4.x & docker 17.x
overflowblobs.test -- timesout
Expand Down
15 changes: 15 additions & 0 deletions tests/TODORR.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Jepsen notes for RR

sudo apt-get install openjdk-11-jdk
sudo apt-get install maven
sudo apt-get install iptables (on all nodes)

export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))
cd comdb2/cdb2jdbc
make install

# on all nodes
sudo sed -i 's/^#*PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
sudo sed -i 's/^#*PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config
sudo systemctl restart sshd
echo 'root:cdb2test' | sudo chpasswd
3 changes: 2 additions & 1 deletion tests/jepsen_a6.test/runit
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#debug_trace="-D"
export CDB2JDBC_STATEMENT_QUERYEFFECTS=1
export CDB2JDBC_VERIFY_RETRY=0
export LEIN="${LEIN:=$TESTSROOTDIR/tools/lein}"

[[ "$debug" == 1 ]] && set -x
needcluster=0
Expand Down Expand Up @@ -98,7 +99,7 @@ function runtestwithoptions
export CDB2_CONFIG_FILE=${CDB2_CONFIG}
(
cd ${TESTSROOTDIR}/tools/linearizable/jepsen
lein run test $testargs > $outfile 2>&1 < /dev/null
$LEIN run test $testargs > $outfile 2>&1 < /dev/null
r=$? ; [[ $r != 0 ]] && echo "XXX JEPSEN ERROR Lein test returns $r" >> $outfile
)
cat $outfile
Expand Down
3 changes: 2 additions & 1 deletion tests/jepsen_a6_nemesis.test/runit
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#debug_trace="-D"
export CDB2JDBC_STATEMENT_QUERYEFFECTS=1
export CDB2JDBC_VERIFY_RETRY=0
export LEIN="${LEIN:=$TESTSROOTDIR/tools/lein}"

[[ "$debug" == 1 ]] && set -x
needcluster=0
Expand Down Expand Up @@ -98,7 +99,7 @@ function runtestwithoptions
export CDB2_CONFIG_FILE=${CDB2_CONFIG}
(
cd ${TESTSROOTDIR}/tools/linearizable/jepsen
lein run test $testargs > $outfile 2>&1 < /dev/null
$LEIN run test $testargs > $outfile 2>&1 < /dev/null
r=$? ; [[ $r != 0 ]] && echo "XXX JEPSEN ERROR Lein test returns $r" >> $outfile
)
cat $outfile
Expand Down
3 changes: 2 additions & 1 deletion tests/jepsen_atomic_writes.test/runit
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#debug_trace="-D"
export CDB2JDBC_STATEMENT_QUERYEFFECTS=1
export CDB2JDBC_VERIFY_RETRY=0
export LEIN="${LEIN:=$TESTSROOTDIR/tools/lein}"

[[ "$debug" == 1 ]] && set -x
needcluster=0
Expand Down Expand Up @@ -98,7 +99,7 @@ function runtestwithoptions
export CDB2_CONFIG_FILE=${CDB2_CONFIG}
(
cd ${TESTSROOTDIR}/tools/linearizable/jepsen
lein run test $testargs > $outfile 2>&1 < /dev/null
$LEIN run test $testargs > $outfile 2>&1 < /dev/null
r=$? ; [[ $r != 0 ]] && echo "XXX JEPSEN ERROR Lein test returns $r" >> $outfile
)
cat $outfile
Expand Down
3 changes: 2 additions & 1 deletion tests/jepsen_bank.test/runit
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#debug_trace="-D"
export CDB2JDBC_STATEMENT_QUERYEFFECTS=1
export CDB2JDBC_VERIFY_RETRY=0
export LEIN="${LEIN:=$TESTSROOTDIR/tools/lein}"

[[ "$debug" == 1 ]] && set -x
needcluster=0
Expand Down Expand Up @@ -97,7 +98,7 @@ function runtestwithoptions
export CDB2_CONFIG_FILE=${CDB2_CONFIG}
(
cd ${TESTSROOTDIR}/tools/linearizable/jepsen
lein run test $testargs > $outfile 2>&1 < /dev/null
$LEIN run test $testargs > $outfile 2>&1 < /dev/null
r=$? ; [[ $r != 0 ]] && echo "XXX JEPSEN ERROR Lein test returns $r" >> $outfile
)
cat $outfile
Expand Down
3 changes: 2 additions & 1 deletion tests/jepsen_bank_nemesis.test/runit
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#debug_trace="-D"
export CDB2JDBC_STATEMENT_QUERYEFFECTS=1
export CDB2JDBC_VERIFY_RETRY=0
export LEIN="${LEIN:=$TESTSROOTDIR/tools/lein}"

[[ "$debug" == 1 ]] && set -x
needcluster=1
Expand Down Expand Up @@ -97,7 +98,7 @@ function runtestwithoptions
export CDB2_CONFIG_FILE=${CDB2_CONFIG}
(
cd ${TESTSROOTDIR}/tools/linearizable/jepsen
lein run test $testargs > $outfile 2>&1 < /dev/null
$LEIN run test $testargs > $outfile 2>&1 < /dev/null
r=$? ; [[ $r != 0 ]] && echo "XXX JEPSEN ERROR Lein test returns $r" >> $outfile
)
cat $outfile
Expand Down
3 changes: 2 additions & 1 deletion tests/jepsen_dirty_reads.test/runit
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#debug_trace="-D"
export CDB2JDBC_STATEMENT_QUERYEFFECTS=1
export CDB2JDBC_VERIFY_RETRY=0
export LEIN="${LEIN:=$TESTSROOTDIR/tools/lein}"

[[ "$debug" == 1 ]] && set -x
needcluster=0
Expand Down Expand Up @@ -97,7 +98,7 @@ function runtestwithoptions
export CDB2_CONFIG_FILE=${CDB2_CONFIG}
(
cd ${TESTSROOTDIR}/tools/linearizable/jepsen
lein run test $testargs > $outfile 2>&1 < /dev/null
$LEIN run test $testargs > $outfile 2>&1 < /dev/null
r=$? ; [[ $r != 0 ]] && echo "XXX JEPSEN ERROR Lein test returns $r" >> $outfile
)
cat $outfile
Expand Down
3 changes: 2 additions & 1 deletion tests/jepsen_g2.test/runit
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#debug_trace="-D"
export CDB2JDBC_STATEMENT_QUERYEFFECTS=1
export CDB2JDBC_VERIFY_RETRY=0
export LEIN="${LEIN:=$TESTSROOTDIR/tools/lein}"

[[ "$debug" == 1 ]] && set -x
needcluster=0
Expand Down Expand Up @@ -99,7 +100,7 @@ function runtestwithoptions
export CDB2_CONFIG_FILE=${CDB2_CONFIG}
(
cd ${TESTSROOTDIR}/tools/linearizable/jepsen
lein run test $testargs > $outfile 2>&1 < /dev/null
$LEIN run test $testargs > $outfile 2>&1 < /dev/null
r=$? ; [[ $r != 0 ]] && echo "XXX JEPSEN ERROR Lein test returns $r" >> $outfile
)
cat $outfile
Expand Down
3 changes: 2 additions & 1 deletion tests/jepsen_register.test/runit
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
export COMDB2_DEBUG=1
export CDB2JDBC_STATEMENT_QUERYEFFECTS=1
export CDB2JDBC_VERIFY_RETRY=0
export LEIN="${LEIN:=$TESTSROOTDIR/tools/lein}"

[[ "$debug" == 1 ]] && set -x
needcluster=0
Expand Down Expand Up @@ -98,7 +99,7 @@ function runtestwithoptions
export CDB2_CONFIG_FILE=${CDB2_CONFIG}
(
cd ${TESTSROOTDIR}/tools/linearizable/jepsen
lein run test $testargs > $outfile 2>&1 < /dev/null
$LEIN run test $testargs > $outfile 2>&1 < /dev/null
r=$? ; [[ $r != 0 ]] && echo "XXX JEPSEN ERROR Lein test returns $r" >> $outfile
)
cat $outfile
Expand Down
3 changes: 2 additions & 1 deletion tests/jepsen_register_nemesis.test/runit
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#debug_trace="-D"
export CDB2JDBC_STATEMENT_QUERYEFFECTS=1
export CDB2JDBC_VERIFY_RETRY=0
export LEIN="${LEIN:=$TESTSROOTDIR/tools/lein}"

[[ "$debug" == 1 ]] && set -x
needcluster=1
Expand Down Expand Up @@ -97,7 +98,7 @@ function runtestwithoptions
export CDB2_CONFIG_FILE=${CDB2_CONFIG}
(
cd ${TESTSROOTDIR}/tools/linearizable/jepsen
lein run test $testargs > $outfile 2>&1 < /dev/null
$LEIN run test $testargs > $outfile 2>&1 < /dev/null
r=$? ; [[ $r != 0 ]] && echo "XXX JEPSEN ERROR Lein test returns $r" >> $outfile
)
cat $outfile
Expand Down
3 changes: 2 additions & 1 deletion tests/jepsen_sets.test/runit
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#debug_trace="-D"
export CDB2JDBC_STATEMENT_QUERYEFFECTS=1
export CDB2JDBC_VERIFY_RETRY=0
export LEIN="${LEIN:=$TESTSROOTDIR/tools/lein}"

[[ "$debug" == 1 ]] && set -x
needcluster=0
Expand Down Expand Up @@ -98,7 +99,7 @@ function runtestwithoptions
export CDB2_CONFIG_FILE=${CDB2_CONFIG}
(
cd ${TESTSROOTDIR}/tools/linearizable/jepsen
lein run test $testargs > $outfile 2>&1 < /dev/null
$LEIN run test $testargs > $outfile 2>&1 < /dev/null
r=$? ; [[ $r != 0 ]] && echo "XXX JEPSEN ERROR Lein test returns $r" >> $outfile
)
cat $outfile
Expand Down
3 changes: 2 additions & 1 deletion tests/jepsen_sets_nemesis.test/runit
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#debug=1
#debug_trace="-D"
export CDB2JDBC_STATEMENT_QUERYEFFECTS=1
export LEIN="${LEIN:=$TESTSROOTDIR/tools/lein}"

[[ "$debug" == 1 ]] && set -x
needcluster=1
Expand Down Expand Up @@ -97,7 +98,7 @@ function runtestwithoptions
export CDB2_CONFIG_FILE=${CDB2_CONFIG}
(
cd ${TESTSROOTDIR}/tools/linearizable/jepsen
lein test $jepsentest > $outfile 2>&1 < /dev/null
$LEIN test $jepsentest > $outfile 2>&1 < /dev/null
r=$? ; [[ $r != 0 ]] && echo "XXX JEPSEN ERROR Lein test returns $r" >> $outfile
)
cat $outfile
Expand Down
Loading
Loading