From 1adfcb1c5135026cd5c3fcb596dc507410675a9c Mon Sep 17 00:00:00 2001 From: kanoi Date: Fri, 8 Apr 2016 21:07:12 +1000 Subject: [PATCH] ckdb - increase seqall highlimit to accommodate different data type processing times --- src/ckdb.c | 23 +++++++++++++++-------- src/ckdb.h | 5 ++++- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/ckdb.c b/src/ckdb.c index 3f7c0f52..0a034cab 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -2200,8 +2200,10 @@ static bool update_seq(enum seq_num seq, uint64_t n_seqcmd, for (i = 0; i < SEQ_MAX; i++) { // Unnecessary - but as a reminder seqset->seqdata[i].SEQINUSE = 0; + seqset->seqdata[i].highlimit = 0; switch (i) { case SEQ_ALL: + seqset->seqdata[i].highlimit = SEQ_ALL_HIGHLIMIT; case SEQ_SHARES: seqset->seqdata[i].size = SEQ_LARGE_SIZ; seqset->seqdata[i].timelimit = SEQ_LARGE_TRANS_LIM; @@ -2227,15 +2229,20 @@ static bool update_seq(enum seq_num seq, uint64_t n_seqcmd, "not a power of", (siz < BASE_SIZ) ? BASE_SIZ : 2); } - highlimit = siz >> HIGH_SHIFT; - if (highlimit < HIGH_MIN) { - // On the first ever seq record - quithere(1, "seqdata[%d] highlimit %d (0x%x) " - "is too small, must be >= %d", - i, highlimit, highlimit, HIGH_MIN); + if (seqset->seqdata[i].highlimit == 0) { + highlimit = siz >> HIGH_SHIFT; + if (highlimit < HIGH_MIN) { + // On the first ever seq record + quithere(1, "seqdata[%d] highlimit %d " + "(0x%x) is too small, must" + " be >= %d", + i, highlimit, highlimit, + HIGH_MIN); + } + seqset->seqdata[i].highlimit = highlimit; } - seqset->seqdata[i].highlimit = highlimit; - seqset->seqdata[i].entry = calloc(siz, sizeof(SEQENTRY)); + seqset->seqdata[i].entry = calloc(siz, + sizeof(SEQENTRY)); end = siz * sizeof(SEQENTRY); off0 = &(seqset->seqdata[i].entry[0]); offn = &(seqset->seqdata[i].entry[siz]); diff --git a/src/ckdb.h b/src/ckdb.h index f9afb5ea..3d9cd2ca 100644 --- a/src/ckdb.h +++ b/src/ckdb.h @@ -51,7 +51,7 @@ #define DB_VLOCK "1" #define DB_VERSION "1.0.5" -#define CKDB_VERSION DB_VERSION"-2.005" +#define CKDB_VERSION DB_VERSION"-2.006" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__ @@ -1351,6 +1351,9 @@ typedef struct seqset { #define SEQ_SMALL_TRANS_LIM 64 #define SEQ_SMALL_SIZ 16384 +// Give SEQ_ALL a much higher limit to allow for all type processing times +#define SEQ_ALL_HIGHLIMIT (SEQ_LARGE_SIZ << 3) + // highlimit ratio (shift down bits) #define HIGH_SHIFT 8 // Smallest highlimit allowed