Permalink
Browse files

debugging Rejected due to restarts issue

  • Loading branch information...
Atreyee committed May 17, 2014
1 parent d920622 commit c71de4d12f7ad53bfbfacdbf18597546fb0d8883
@@ -26,13 +26,14 @@ BASE_PROJECT="articles"
BASE_DIR=`pwd`
OUTPUT_DIR="~/data/articles/read-heavy/2/80-20"
ANTICACHE_BLOCK_SIZE=1048576
ANTICACHE_BLOCK_SIZE=500000
ANTICACHE_THRESHOLD=.5
BASE_ARGS=( \
# SITE DEBUG
"-Dsite.status_enable=false" \
#"-Dsite.status_interval=10000" \
"-Dsite.status_interval=10000" \
"-Dsite.txn_restart_limit=35" \
# "-Dsite.status_exec_info=true" \
# "-Dsite.status_check_for_zombies=true" \
# "-Dsite.exec_profiling=true" \
@@ -45,8 +46,8 @@ BASE_ARGS=( \
# Site Params
"-Dsite.jvm_asserts=false" \
#"-Dsite.specexec_enable=false" \
#"-Dsite.cpu_affinity_one_partition_per_core=true" \
"-Dsite.specexec_enable=false" \
"-Dsite.cpu_affinity_one_partition_per_core=true" \
#"-Dsite.cpu_partition_blacklist=0,2,4,6,8,10,12,14,16,18" \
#"-Dsite.cpu_utility_blacklist=0,2,4,6,8,10,12,14,16,18" \
#"-Dsite.network_incoming_limit_txns=50000" \
@@ -69,22 +70,22 @@ BASE_ARGS=( \
"-Dclient.interval=5000" \
"-Dclient.shared_connection=false" \
"-Dclient.blocking=true" \
"-Dclient.blocking_concurrent=100" \
"-Dclient.blocking_concurrent=1" \
"-Dclient.throttle_backoff=100" \
"-Dclient.output_interval=5000" \
# "-Dclient.output_anticache_evictions=evictions.csv" \
# "-Dclient.output_memory=memory.csv" \
# Anti-Caching Experiments
"-Dsite.anticache_enable=${ENABLE_ANTICACHE}" \
"-Dsite.anticache_batching=true" \
#"-Dsite.anticache_batching=true" \
# "-Dsite.anticache_profiling=true" \
"-Dsite.anticache_reset=false" \
"-Dsite.anticache_block_size=${ANTICACHE_BLOCK_SIZE}" \
"-Dsite.anticache_check_interval=5000" \
"-Dsite.anticache_check_interval=30000" \
"-Dsite.anticache_threshold_mb=5" \
"-Dsite.anticache_blocks_per_eviction=30" \
"-Dsite.anticache_max_evicted_blocks=1000" \
"-Dsite.anticache_blocks_per_eviction=16" \
"-Dsite.anticache_max_evicted_blocks=1600" \
# "-Dsite.anticache_evict_size=${ANTICACHE_EVICT_SIZE}" \
"-Dsite.anticache_threshold=${ANTICACHE_THRESHOLD}" \
"-Dclient.anticache_enable=false" \
@@ -93,7 +94,7 @@ BASE_ARGS=( \
"-Dclient.output_csv=results.csv" \
# CLIENT DEBUG
# "-Dclient.output_txn_counters=txncounters.csv" \
"-Dclient.output_txn_counters=txncounters.csv" \
"-Dclient.output_clients=false" \
"-Dclient.profiling=false" \
"-Dclient.output_response_status=false" \
@@ -140,16 +141,16 @@ done
wait
ant compile
HSTORE_HOSTS="${SITE_HOST}:0:0"
NUM_CLIENTS=`expr 1 \* $BASE_CLIENT_THREADS`
SITE_MEMORY=`expr $BASE_SITE_MEMORY + \( 1 \* $BASE_SITE_MEMORY_PER_PARTITION \)`
HSTORE_HOSTS="${SITE_HOST}:0:0-7"
NUM_CLIENTS=`expr 8 \* $BASE_CLIENT_THREADS`
SITE_MEMORY=`expr $BASE_SITE_MEMORY + \( 8 \* $BASE_SITE_MEMORY_PER_PARTITION \)`
# BUILD PROJECT JAR
ant hstore-prepare \
-Dproject=${BASE_PROJECT} \
-Dhosts=${HSTORE_HOSTS} \
-Dbatchevictable=${BATCHEVICTABLES} \
-Devictable=${EVICTABLES}
-Devictable=${EVICTABLES}
#-Dbatchevictable=${BATCHEVICTABLES} \
test -f ${BASE_PROJECT}.jar || exit -1
# UPDATE CLIENTS
@@ -179,6 +180,8 @@ ant compile
-Dsite.memory=${SITE_MEMORY} \
-Dclient.hosts=${CLIENT_HOSTS_STR} \
-Dclient.count=${CLIENT_COUNT}
#-Dnoloader=true \
#-Dnostart=true \
result=$?
if [ $result != 0 ]; then
exit $result
View
@@ -11,17 +11,15 @@ function onexit() {
# ---------------------------------------------------------------------
ENABLE_ANTICACHE=false
ENABLE_ANTICACHE=true
SITE_HOST="istc12"
CLIENT_HOSTS=( \
"istc12" \
"istc13" \
"istc13" \
)
BASE_CLIENT_THREADS=2
BASE_CLIENT_THREADS=1
BASE_SITE_MEMORY=8192
BASE_SITE_MEMORY_PER_PARTITION=1024
BASE_PROJECT="ycsb"
@@ -70,7 +68,7 @@ BASE_ARGS=( \
"-Dclient.duration=300000" \
"-Dclient.interval=5000" \
"-Dclient.shared_connection=false" \
"-Dclient.blocking=false" \
"-Dclient.blocking=true" \
"-Dclient.blocking_concurrent=100" \
"-Dclient.throttle_backoff=100" \
"-Dclient.output_interval=5000" \
@@ -79,11 +77,12 @@ BASE_ARGS=( \
# Anti-Caching Experiments
"-Dsite.anticache_enable=${ENABLE_ANTICACHE}" \
"-Dsite.anticache_batching=true" \
# "-Dsite.anticache_profiling=true" \
"-Dsite.anticache_reset=false" \
"-Dsite.anticache_block_size=${ANTICACHE_BLOCK_SIZE}" \
"-Dsite.anticache_check_interval=5000" \
"-Dsite.anticache_threshold_mb=2500" \
"-Dsite.anticache_threshold_mb=100" \
"-Dsite.anticache_blocks_per_eviction=200" \
"-Dsite.anticache_max_evicted_blocks=325" \
# "-Dsite.anticache_evict_size=${ANTICACHE_EVICT_SIZE}" \
@@ -54,6 +54,7 @@ public ArticlesClient(String[] args) {
}
public static enum Transaction {
GET_ARTICLE("Get Article", ArticlesConstants.FREQUENCY_GET_ARTICLE),
GET_COMMENTS("Get Comments", ArticlesConstants.FREQUENCY_GET_COMMENTS),
ADD_COMMENT("Add Comment", ArticlesConstants.FREQUENCY_ADD_COMMENT),
UPDATE_USER("Update User Info", ArticlesConstants.FREQUENCY_UPDATE_USER_INFO);
@@ -82,13 +83,21 @@ protected boolean runOnce() throws IOException {
// ProcedureCallback callback = null;
switch (target) {
case GET_ARTICLE: {
long articlesSize = Math.round(ArticlesConstants.ARTICLES_SIZE * this.getScaleFactor());
params = new Object[]{ articlesSize - ((Random) this.readRecord).nextInt() };
//long articlesSize = Math.round(ArticlesConstants.ARTICLES_SIZE * this.getScaleFactor());
params = new Object[]{ ((Random) this.readRecord).nextInt() };
// callback = new GetCommentsCallback(this.getClientHandle(), params);
break;
}
case GET_COMMENTS: {
//long articlesSize = Math.round(ArticlesConstants.ARTICLES_SIZE * this.getScaleFactor());
params = new Object[]{ ((Random) this.readRecord).nextInt() };
// callback = new GetCommentsCallback(this.getClientHandle(), params);
break;
}
case ADD_COMMENT: {
int a_id = this.readRecord.nextInt(); // aid
//long articlesSize = Math.round(ArticlesConstants.ARTICLES_SIZE * this.getScaleFactor());
int a_id = this.readRecord.nextInt();
//int a_id = this.readRecord.nextInt(); // aid
int u_id = this.userRecord.nextInt();// uid
String text = ArticlesUtil.astring(100, 100);
params = new Object[]{ a_id, u_id, text};
@@ -6,8 +6,9 @@
// STORED PROCEDURE EXECUTION FREQUENCIES (0-100)
// ----------------------------------------------------------------
public static final int FREQUENCY_GET_ARTICLE = 50;
public static final int FREQUENCY_ADD_COMMENT = 40;
public static final int FREQUENCY_GET_ARTICLE = 35;
public static final int FREQUENCY_ADD_COMMENT = 20;
public static final int FREQUENCY_GET_COMMENTS = 35;
public static final int FREQUENCY_UPDATE_USER_INFO = 10;
// ----------------------------------------------------------------
@@ -26,6 +27,6 @@
TABLENAME_USERS,
TABLENAME_COMMENTS
};
public static final long MAX_COMMENTS_PER_ARTICLE = 10;
public static final long MAX_COMMENTS_PER_ARTICLE = 5;
public static final int COMMENTS_NUM_COLUMNS = 0;
}
@@ -73,6 +73,22 @@ void genArticles(Table catalog_tbl) {
long numComments = ArticlesUtil.number(0, this.maxComments);
row[col++] = numComments; // number of comments
row[col++] = ArticlesUtil.astring(8, 8); // text
row[col++] = ArticlesUtil.astring(8, 8); // text
row[col++] = ArticlesUtil.astring(8, 8); // text
row[col++] = ArticlesUtil.astring(8, 8); // text
row[col++] = ArticlesUtil.astring(8, 8); // text
row[col++] = ArticlesUtil.astring(8, 8); // text
row[col++] = ArticlesUtil.astring(8, 8); // text
row[col++] = ArticlesUtil.astring(8, 8); // text
row[col++] = ArticlesUtil.astring(8, 8); // text
row[col++] = ArticlesUtil.astring(8, 8); // text
row[col++] = ArticlesUtil.astring(8, 8); // text
row[col++] = ArticlesUtil.astring(8, 8); // text
row[col++] = ArticlesUtil.astring(8, 8); // text
row[col++] = ArticlesUtil.astring(8, 8); // text
row[col++] = ArticlesUtil.astring(8, 8); // text
this.articleToCommentMap.put(a_id, numComments);
// assert col == table.getColumnCount();
table.addRow(row);
@@ -154,7 +170,19 @@ void genComments(Table catalog_comments) {
row_spe[0] = a_id*ArticlesConstants.MAX_COMMENTS_PER_ARTICLE+i;
row_spe[1] = a_id; // random number from the article id
row_spe[2] = ArticlesUtil.number(0, this.usersSize); // random number from user id
row_spe[3] = ArticlesUtil.astring(5, 5); // comment
row_spe[3] = ArticlesUtil.astring(100, 100); // comment
row_spe[4] = ArticlesUtil.astring(8, 8); // comment
row_spe[5] = ArticlesUtil.astring(8, 8); // comment
row_spe[6] = ArticlesUtil.astring(8, 8); // comment
row_spe[7] = ArticlesUtil.astring(8, 8); // comment
row_spe[8] = ArticlesUtil.astring(8, 8); // comment
row_spe[9] = ArticlesUtil.astring(8, 8); // comment
row_spe[10] = ArticlesUtil.astring(8, 8); // comment
row_spe[11] = ArticlesUtil.astring(8, 8); // comment
row_spe[12] = ArticlesUtil.astring(8, 8); // comment
row_spe[13] = ArticlesUtil.astring(8, 8); // comment
speTbl.addRow(row_spe);
speTotal++;
if (speTbl.getRowCount() >= ArticlesConstants.BATCH_SIZE) {
@@ -16,12 +16,14 @@
@SuppressWarnings("unchecked")
public static final Class<? extends VoltProcedure> PROCEDURES[] = (Class<? extends VoltProcedure>[]) new Class<?>[] {
GetArticle.class,
GetComments.class,
AddComment.class,
UpdateUserInfo.class
};
{
// Transaction Frequencies
addTransactionFrequency(GetArticle.class, ArticlesConstants.FREQUENCY_GET_ARTICLE);
addTransactionFrequency(GetComments.class, ArticlesConstants.FREQUENCY_GET_COMMENTS);
addTransactionFrequency(AddComment.class, ArticlesConstants.FREQUENCY_ADD_COMMENT);
addTransactionFrequency(UpdateUserInfo.class, ArticlesConstants.FREQUENCY_UPDATE_USER_INFO);
@@ -1,40 +1,76 @@
package edu.brown.benchmark.articles.procedures;
import org.apache.log4j.Logger;
import org.voltdb.ProcInfo;
import org.voltdb.SQLStmt;
import org.voltdb.VoltProcedure;
import org.voltdb.VoltTable;
import org.voltdb.exceptions.SerializableException;
import org.voltdb.exceptions.EvictedTupleAccessException;
import edu.brown.benchmark.articles.ArticlesConstants;
import edu.brown.logging.LoggerUtil;
import edu.brown.logging.LoggerUtil.LoggerBoolean;
@ProcInfo(
partitionParam = 1,
partitionParam = 0,
singlePartition = true
)
public class AddComment extends VoltProcedure{
// -- c_id Comment's ID
// -- a_id Article's ID
// -- u_id User's ID
// -- c_text Actual comment text
public static final Logger LOG = Logger.getLogger(AddComment.class);
private static final LoggerBoolean debug = new LoggerBoolean();
private static final LoggerBoolean trace = new LoggerBoolean();
static {
LoggerUtil.setupLogging();
LoggerUtil.attachObserver(LOG, debug, trace);
}
public final SQLStmt GetNumComments = new SQLStmt("SELECT A_NUM_COMMENTS FROM ARTICLES WHERE A_ID=?");
public final SQLStmt AddComment = new SQLStmt("INSERT INTO COMMENTS(C_ID,C_A_ID,C_U_ID,C_TEXT) VALUES(?, ?, ?, ?)");
public final SQLStmt UpdateArticle = new SQLStmt("UPDATE ARTICLES SET A_NUM_COMMENTS=? WHERE A_ID=?");
public VoltTable[] run(long a_id, long u_id, String c_text) {
voltQueueSQL(GetNumComments, a_id);
VoltTable[] results = voltExecuteSQL();
VoltTable[] results;
try {
voltQueueSQL(GetNumComments, a_id);
results = voltExecuteSQL();
} catch (SerializableException ex) {
LOG.info("After comments Num comments");
System.out.println(ex);
if(ex instanceof EvictedTupleAccessException){
EvictedTupleAccessException exception = (EvictedTupleAccessException) ex;
LOG.info(exception.block_ids[0]);
System.out.println(a_id);
}
throw ex;
}
boolean adv = results[0].advanceRow();
//assert (adv);
long num_comments = results[0].getLong(0);
if(num_comments == ArticlesConstants.MAX_COMMENTS_PER_ARTICLE){
return results;
}
long c_id = a_id*ArticlesConstants.MAX_COMMENTS_PER_ARTICLE+num_comments;
try{
voltQueueSQL(AddComment, c_id, a_id, u_id, c_text);
voltExecuteSQL();
} catch (SerializableException ex){
LOG.info("After add comment");
throw ex;
}
voltQueueSQL(UpdateArticle, num_comments+1, a_id);
results = voltExecuteSQL(true);
try{
voltQueueSQL(UpdateArticle, num_comments+1, a_id);
results = voltExecuteSQL(true);
}catch (SerializableException ex){
LOG.info("After update article");
throw ex;
}
assert results.length == 1;
return results;
}
@@ -1,22 +1,57 @@
package edu.brown.benchmark.articles.procedures;
import org.apache.log4j.Logger;
import org.voltdb.*;
import org.voltdb.exceptions.EvictedTupleAccessException;
import org.voltdb.exceptions.SerializableException;
import edu.brown.logging.LoggerUtil;
import edu.brown.logging.LoggerUtil.LoggerBoolean;
@ProcInfo(
partitionParam = 0,
singlePartition = true
)
public class GetArticle extends VoltProcedure{
public static final Logger LOG = Logger.getLogger(AddComment.class);
private static final LoggerBoolean debug = new LoggerBoolean();
private static final LoggerBoolean trace = new LoggerBoolean();
static {
LoggerUtil.setupLogging();
LoggerUtil.attachObserver(LOG, debug, trace);
}
public final SQLStmt GetArticle = new SQLStmt("SELECT * FROM ARTICLES WHERE A_ID = ? ");
public final SQLStmt GetComments = new SQLStmt("SELECT * FROM COMMENTS WHERE C_A_ID = ? ");
//public final SQLStmt GetComments = new SQLStmt("SELECT * FROM COMMENTS WHERE C_A_ID = ? ");
// public final SQLStmt GetUser = new SQLStmt("SELECT * FROM USERS JOIN COMMENTS ON USERS.U_ID = COMMENTS.U_ID WHERE A_ID = ? ");
public VoltTable[] run(long a_id) {
try {
voltQueueSQL(GetArticle, a_id);
voltExecuteSQL();
voltQueueSQL(GetComments, a_id);
return voltExecuteSQL(true);
} catch (SerializableException ex) {
LOG.info("After get article");
System.out.println(ex);
if(ex instanceof EvictedTupleAccessException){
EvictedTupleAccessException exception = (EvictedTupleAccessException) ex;
LOG.info(exception.block_ids[0]);
System.out.println(a_id);
}
throw ex;
}
/* try{
voltQueueSQL(GetComments, a_id);
return voltExecuteSQL(true);
} catch (SerializableException ex) {
LOG.info("After get comments");
System.out.println(ex);
if(ex instanceof EvictedTupleAccessException){
EvictedTupleAccessException exception = (EvictedTupleAccessException) ex;
LOG.info(exception.block_ids[0]);
System.out.println(a_id);
}
throw ex;
}
*/
}
}
Oops, something went wrong.

0 comments on commit c71de4d

Please sign in to comment.