Commit d7535d5a authored by Geoff Simmons's avatar Geoff Simmons

enforce a minimum chunk size

parent b74600ce
...@@ -138,7 +138,6 @@ CONF_Add(const char *lval, const char *rval) ...@@ -138,7 +138,6 @@ CONF_Add(const char *lval, const char *rval)
confUnsigned("max.reclen", max_reclen); confUnsigned("max.reclen", max_reclen);
confUnsigned("maxkeylen", maxkeylen); confUnsigned("maxkeylen", maxkeylen);
confUnsigned("chunk.size", chunk_size);
confUnsigned("qlen.goal", qlen_goal); confUnsigned("qlen.goal", qlen_goal);
confUnsigned("nworkers", nworkers); confUnsigned("nworkers", nworkers);
confUnsigned("restarts", restarts); confUnsigned("restarts", restarts);
...@@ -150,6 +149,17 @@ CONF_Add(const char *lval, const char *rval) ...@@ -150,6 +149,17 @@ CONF_Add(const char *lval, const char *rval)
confNonNegativeDouble("idle.pause", idle_pause); confNonNegativeDouble("idle.pause", idle_pause);
confNonNegativeDouble("tx.timeout", tx_timeout); confNonNegativeDouble("tx.timeout", tx_timeout);
if (strcmp(lval, "chunk.size") == 0) {
unsigned int i;
int err = conf_getUnsignedInt(rval, &i);
if (err != 0)
return err;
if (i < MIN_CHUNK_SIZE)
return EINVAL;
config.chunk_size = i;
return(0);
}
if (strcmp(lval, "max.records") == 0) { if (strcmp(lval, "max.records") == 0) {
unsigned int i; unsigned int i;
int err = conf_getUnsignedInt(rval, &i); int err = conf_getUnsignedInt(rval, &i);
......
...@@ -29,7 +29,7 @@ rm -f $LOG $MSG ...@@ -29,7 +29,7 @@ rm -f $LOG $MSG
# "Not running as root" filtered so that the test is independent of # "Not running as root" filtered so that the test is independent of
# the user running it # the user running it
CKSUM=$( grep -v 'Worker 1' $LOG | sed -e 's/\(initializing\) \(.*\)/\1/' | sed -e 's/\(Running as\) \([a-zA-Z0-9]*\)$/\1/' | grep -v 'Not running as root' | cksum) CKSUM=$( grep -v 'Worker 1' $LOG | sed -e 's/\(initializing\) \(.*\)/\1/' | sed -e 's/\(Running as\) \([a-zA-Z0-9]*\)$/\1/' | grep -v 'Not running as root' | cksum)
if [ "$CKSUM" != '625760318 214345' ]; then if [ "$CKSUM" != '3927549947 214347' ]; then
echo "ERROR: Regression test incorrect reader log cksum: $CKSUM" echo "ERROR: Regression test incorrect reader log cksum: $CKSUM"
exit 1 exit 1
fi fi
......
...@@ -222,7 +222,8 @@ struct config { ...@@ -222,7 +222,8 @@ struct config {
unsigned restart_pause; unsigned restart_pause;
unsigned thread_restarts; unsigned thread_restarts;
unsigned chunk_size; unsigned chunk_size;
#define DEF_CHUNK_SIZE 64 #define DEF_CHUNK_SIZE 256
#define MIN_CHUNK_SIZE 64
unsigned tx_limit; unsigned tx_limit;
} config; } config;
......
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